From: <cl...@us...> - 2003-11-23 01:54:22
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1:/tmp/cvs-serv7356/functions Modified Files: ical_parser.php Log Message: Fixed a problem with bleed time not being able to figure out days at the end of the month. Also corrected end times on those dates and added a proper until_check before writing split events. Index: ical_parser.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ical_parser.php,v retrieving revision 1.133 retrieving revision 1.134 diff -C2 -d -r1.133 -r1.134 *** ical_parser.php 23 Nov 2003 00:11:20 -0000 1.133 --- ical_parser.php 23 Nov 2003 01:54:19 -0000 1.134 *************** *** 182,186 **** if (isset($start_unixtime,$end_unixtime) && date('d',$start_unixtime) != date('d',$end_unixtime)) { $spans_day = true; ! $bleed_check = ((date('d',$start_unixtime)) - (date('d',$end_unixtime))); } else { $spans_day = false; --- 182,186 ---- if (isset($start_unixtime,$end_unixtime) && date('d',$start_unixtime) != date('d',$end_unixtime)) { $spans_day = true; ! $bleed_check = (($start_unixtime - $end_unixtime) < (60*60*24)) ? '-1' : '0'; } else { $spans_day = false; *************** *** 254,258 **** $end_time_tmp = $end_time; } else { ! $end_time_tmp = '0000'; } $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, $end_time_tmp, $uid); --- 254,259 ---- $end_time_tmp = $end_time; } else { ! $end_time_tmp = '2400'; ! $display_end_tmp = '0000'; } $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, $end_time_tmp, $uid); *************** *** 597,604 **** $end_time_tmp = $end_time; } else { ! $end_time_tmp = '0000'; } - $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, $end_time_tmp, $uid); - $master_array[$start_date_tmp][$time_tmp][$uid] = array ('event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, 'display_end' => $display_end_tmp, 'start_unixtime' => $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => true, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber, 'calname' => $actual_calname, 'url' => $url) ; $start_tmp = strtotime('+1 day',$start_tmp); } --- 598,611 ---- $end_time_tmp = $end_time; } else { ! $end_time_tmp = '2400'; ! $display_end_tmp = '0000'; ! } ! ! // Let's double check the until to not write past it ! $until_check = $recur_data_date.$time_tmp.'00'; ! if ($abs_until > $until_check) { ! $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, $end_time_tmp, $uid); ! $master_array[$start_date_tmp][$time_tmp][$uid] = array ('event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, 'display_end' => $display_end_tmp, 'start_unixtime' => $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => true, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber, 'calname' => $actual_calname, 'url' => $url) ; } $start_tmp = strtotime('+1 day',$start_tmp); } *************** *** 606,612 **** if ($bleed_check == '-1') { $display_end_tmp = $end_time; ! $end_time_tmp1 = '2400'; } - if (!isset($end_time_tmp1)) $end_time_tmp1 = $end_time; --- 613,619 ---- if ($bleed_check == '-1') { $display_end_tmp = $end_time; ! $end_time_tmp1 = '2400'; ! } if (!isset($end_time_tmp1)) $end_time_tmp1 = $end_time; |