Changeset 4431 for branches/2.2


Ignore:
Timestamp:
05/17/11 15:36:35 (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/expressoMail1_2/inc/class.imap_functions.inc.php

    r4428 r4431  
    34123412        function make_search_date($date){ 
    34133413 
    3414             $months = array( 
    3415                 1   => 'jan', 
    3416                 2   => 'feb', 
    3417                 3   => 'mar', 
    3418                 4   => 'apr', 
    3419                 5   => 'may', 
    3420                 6   => 'jun', 
    3421                 7   => 'jul', 
    3422                 8   => 'aug', 
    3423                 9   => 'sep', 
    3424                 10  => 'oct', 
    3425                 11  => 'nov', 
    3426                 12  => 'dec' 
    3427             ); 
    3428  
    34293414            //TODO: Adaptar a data de acordo com o locale do sistema. 
    34303415            list($day,$month,$year) = explode("/", $date); 
    3431             $search_date = $day."-".$months[intval($month)]."-".$year; 
     3416            $before?$day=(int)$day+1:$day=(int)$day; 
     3417            $timestamp = mktime(0,0,0,(int)$month,$day,(int)$year); 
     3418            $search_date = date('d-M-Y',$timestamp); 
    34323419            return $search_date; 
    34333420 
     
    34733460                                                        { 
    34743461                                                            $filter .= '"'.$filter_array[1].'"'; 
    3475                                                         } 
    3476                                                         else 
    3477                                                         { 
     3462                                                        }else if(trim($filter_array[0]) == 'BEFORE' ){ 
     3463                                                            $filter .= '"'.$this->make_search_date($filter_array[1],true).'"'; 
     3464                                                        }else{ 
    34783465                                                                $filter .= '"'.$this->make_search_date($filter_array[1]).'"'; 
    34793466                                                        } 
Note: See TracChangeset for help on using the changeset viewer.