WordPress.org

Plugin Directory

Changeset 598572


Ignore:
Timestamp:
09/13/12 17:02:40 (22 months ago)
Author:
joedolson
Message:

Hotfix; month output problem missing last day when last day of month is Sunday and first day of week is Sunday

File:
1 edited

Legend:

Unmodified
Added
Removed
  • my-calendar/trunk/my-calendar-output.php

    r598242 r598572  
    484484                $endtime = mktime(0,0,0,date('m',$timestamp),date('t',$timestamp),date('Y',$timestamp) ); 
    485485                $last = date('N', $endtime ); $n = ( get_option('start_of_week')==1 )?7-$last:6-$last; 
    486             $to =  date('Y-m-d',strtotime( "+$n days", $endtime ) );     
     486            if ( $n == '-1' && date('N',$endtime ) == '7' ) { $n = 6; } 
     487            $to =  date('Y-m-d',strtotime( "+$n days", $endtime ) ); 
    487488            return array( 'from'=>$from,'to'=>$to ); 
    488489        break; 
     
    658659        $from = $this_dates['from']; 
    659660        $to = $this_dates['to']; 
    660         //echo "<pre>$from, $to ($c_month,$c_day,$c_year)</pre>"; 
     661        //echo "<pre>$num $from, $to ($c_month,$c_day,$c_year)</pre>"; 
    661662        $events = my_calendar_grab_events( $from, $to, $category, $ltype, $lvalue,'calendar',$author ); 
    662663        // get events into an easily parseable set, keyed by date. 
Note: See TracChangeset for help on using the changeset viewer.