From: <ji...@us...> - 2006-03-19 08:17:23
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9774/phpicalendar/functions Modified Files: date_functions.php ical_parser.php Log Message: fix bug [ 1362515 ] December Monthly View Corruption- shifting repeated events Index: date_functions.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/date_functions.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** date_functions.php 16 Mar 2006 00:28:54 -0000 1.33 --- date_functions.php 19 Mar 2006 08:17:18 -0000 1.34 *************** *** 50,63 **** function weekCompare($now, $then) { global $week_start_day; ! $sun_now = dateOfWeek($now, $week_start_day); ! $sun_then = dateOfWeek($then, $week_start_day); $seconds_now = strtotime($sun_now); $seconds_then = strtotime($sun_then); ! $diff_seconds = $seconds_now - $seconds_then; ! $diff_minutes = $diff_seconds/60; ! $diff_hours = $diff_minutes/60; ! $diff_days = round($diff_hours/24); ! $diff_weeks = $diff_days/7; ! return $diff_weeks; } --- 50,58 ---- function weekCompare($now, $then) { global $week_start_day; ! $sun_now = dateOfWeek($now, "Sunday"); ! $sun_then = dateOfWeek($then, "Sunday"); $seconds_now = strtotime($sun_now); $seconds_then = strtotime($sun_then); ! $diff_weeks = round(($seconds_now - $seconds_then)/(60*60*24*7)); return $diff_weeks; } Index: ical_parser.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ical_parser.php,v retrieving revision 1.205 retrieving revision 1.206 diff -C2 -d -r1.205 -r1.206 *** ical_parser.php 18 Mar 2006 21:47:39 -0000 1.205 --- ical_parser.php 19 Mar 2006 08:17:19 -0000 1.206 *************** *** 300,304 **** while (($start != $end) && ($start < $mArray_end)) { $start_date2 = date('Ymd', $start); ! $master_array[($start_date2)][('-1')][$uid]= array ('event_text' => $summary, 'description' => $description, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber, 'calname' => $actual_calname, 'url' => $url, 'status' => $status, 'class' => $class ); $start = strtotime('+1 day', $start); } --- 300,314 ---- while (($start != $end) && ($start < $mArray_end)) { $start_date2 = date('Ymd', $start); ! $master_array[($start_date2)][('-1')][$uid]= array ( ! 'event_text' => $summary, ! 'description' => $description, ! 'location' => $location, ! 'organizer' => serialize($organizer), ! 'attendee' => serialize($attendee), ! 'calnumber' => $calnumber, ! 'calname' => $actual_calname, ! 'url' => $url, ! 'status' => $status, ! 'class' => $class ); $start = strtotime('+1 day', $start); } *************** *** 528,532 **** // if the beginning of our range is less than the start of the item, we may as well set it equal to it ! if ($start_range_time_tmp < $start_date_time) $start_range_time_tmp = $start_date_time; if ($end_range_time_tmp > $end_date_time) $end_range_time_tmp = $end_date_time; --- 538,544 ---- // if the beginning of our range is less than the start of the item, we may as well set it equal to it ! if ($start_range_time_tmp < $start_date_time){ ! $start_range_time_tmp = $start_date_time; ! } if ($end_range_time_tmp > $end_date_time) $end_range_time_tmp = $end_date_time; *************** *** 558,562 **** foreach($byday as $day) { $day = two2threeCharDays($day); ! $next_date_time = strtotime($day,$next_range_time) + (12 * 60 * 60); // Since this renders events from $next_range_time to $next_range_time + 1 week, I need to handle intervals // as well. This checks to see if $next_date_time is after $day_start (i.e., "next week"), and thus --- 570,581 ---- foreach($byday as $day) { $day = two2threeCharDays($day); ! #need to find the first day of the appropriate week. ! $the_sunday = dateOfWeek(date("Ymd",$next_range_time), 'Sunday'); ! $next_date_time = strtotime($day,strtotime($the_sunday)) + (12 * 60 * 60); ! ! #reset $next_range_time to first instance in this week. ! if ($next_date_time < $next_range_time){ ! $next_range_time = $next_date_time; ! } // Since this renders events from $next_range_time to $next_range_time + 1 week, I need to handle intervals // as well. This checks to see if $next_date_time is after $day_start (i.e., "next week"), and thus |