Changeset 4430 for branches/2.2.0.1


Ignore:
Timestamp:
05/17/11 15:29:52 (13 years ago)
Author:
brunocosta
Message:

Ticket #1902 - aumenta a data passada para pesquisa em 1 dia.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.0.1/expressoMail1_2/inc/class.imap_functions.inc.php

    r4252 r4430  
    34183418        } 
    34193419 
    3420         function make_search_date($date){ 
    3421  
    3422             $months = array( 
    3423                 1   => 'jan', 
    3424                 2   => 'feb', 
    3425                 3   => 'mar', 
    3426                 4   => 'apr', 
    3427                 5   => 'may', 
    3428                 6   => 'jun', 
    3429                 7   => 'jul', 
    3430                 8   => 'aug', 
    3431                 9   => 'sep', 
    3432                 10  => 'oct', 
    3433                 11  => 'nov', 
    3434                 12  => 'dec' 
    3435             ); 
     3420        function make_search_date($date,$before = false){ 
     3421 
    34363422 
    34373423            //TODO: Adaptar a data de acordo com o locale do sistema. 
    34383424            list($day,$month,$year) = explode("/", $date); 
    3439             $search_date = $day."-".$months[intval($month)]."-".$year; 
     3425            $before?$day=(int)$day+1:$day=(int)$day; 
     3426            $timestamp = mktime(0,0,0,(int)$month,$day,(int)$year); 
     3427            $search_date = date('d-M-Y',$timestamp); 
    34403428            return $search_date; 
    34413429 
     
    34813469                                                        { 
    34823470                                                            $filter .= '"'.$filter_array[1].'"'; 
    3483                                                         } 
    3484                                                         else 
     3471                                                        }else if(trim($filter_array[0]) == 'BEFORE' ) 
    34853472                                                        { 
    3486                                                                 $filter .= '"'.$this->make_search_date($filter_array[1]).'"'; 
    3487                                                         } 
     3473                                                            $filter .= '"'.$this->make_search_date($filter_array[1],true).'"'; 
     3474                                                        }else{ 
     3475                                                            $filter .= '"'.$this->make_search_date($filter_array[1]).'"'; 
     3476                                                        } 
    34883477                                                } 
    34893478                                        } 
Note: See TracChangeset for help on using the changeset viewer.