aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2003-11-23 01:54:19 +0000
committerChad Little <clittle@users.sourceforge.net>2003-11-23 01:54:19 +0000
commit53c6aee874980d254136c9e6c37a40e3528358b8 (patch)
tree4b80d12edaa005c138df398929eaf70b0c16b744 /functions
parent2751b93b7178bebdd6b33dc69b847e987c6a496e (diff)
downloadphpicalendar-53c6aee874980d254136c9e6c37a40e3528358b8.tar.gz
phpicalendar-53c6aee874980d254136c9e6c37a40e3528358b8.tar.bz2
phpicalendar-53c6aee874980d254136c9e6c37a40e3528358b8.zip
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.
Diffstat (limited to 'functions')
-rw-r--r--functions/ical_parser.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 699fa31..2d23d79 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -181,7 +181,7 @@ foreach ($cal_filelist as $filename) {
}
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)));
+ $bleed_check = (($start_unixtime - $end_unixtime) < (60*60*24)) ? '-1' : '0';
} else {
$spans_day = false;
$bleed_check = 0;
@@ -253,7 +253,8 @@ foreach ($cal_filelist as $filename) {
if ($start_date_tmp == $end_date_tmp) {
$end_time_tmp = $end_time;
} else {
- $end_time_tmp = '0000';
+ $end_time_tmp = '2400';
+ $display_end_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, 'end_unixtime' => $end_unixtime, '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 );
@@ -596,18 +597,24 @@ foreach ($cal_filelist as $filename) {
if ($start_date_tmp == $end_date_tmp) {
$end_time_tmp = $end_time;
} else {
- $end_time_tmp = '0000';
+ $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) ;
}
- $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);
}
} else {
if ($bleed_check == '-1') {
$display_end_tmp = $end_time;
- $end_time_tmp1 = '2400';
+ $end_time_tmp1 = '2400';
+
}
-
if (!isset($end_time_tmp1)) $end_time_tmp1 = $end_time;
// Let's double check the until to not write past it

© 2014-2024 Faster IT GmbH | imprint | privacy policy