From dc5600eaf6d6e66a65c8fe84e98c862db28510a1 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Wed, 24 Dec 2008 09:54:28 +0000 Subject: fix to use UTC for until --- calendars/recur_tests/ex_set5.ics | 1 + functions/parse/end_vevent.php | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/calendars/recur_tests/ex_set5.ics b/calendars/recur_tests/ex_set5.ics index 862a743..bc042b2 100644 --- a/calendars/recur_tests/ex_set5.ics +++ b/calendars/recur_tests/ex_set5.ics @@ -76,6 +76,7 @@ SUMMARY:Every Friday the 13th, forever STATUS:CONFIRMED DURATION:PT1H30M EXDATE;TZID=US/Eastern:19970902T090000 +DTSTART;TZID=US/Eastern:19970902T090000 RRULE:FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13 END:VEVENT END:VCALENDAR diff --git a/functions/parse/end_vevent.php b/functions/parse/end_vevent.php index 2ccd3a9..1dfe221 100644 --- a/functions/parse/end_vevent.php +++ b/functions/parse/end_vevent.php @@ -11,7 +11,7 @@ What happens in this file: 3. Add occurrences to master_array */ -if (!isset($start_date)) echo "no start date for $summary
"; +if (!isset($start_date)) $start_date = "19700101"; // Handle DURATION if (!isset($end_unixtime)) { @@ -131,11 +131,13 @@ foreach ($rrule_array as $key => $val) { $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = $count; break; case 'UNTIL': - $until = str_replace('T', '', $val); - $until = str_replace('Z', '', $until); - if (strlen($until) == 8) $until = $until.'235959'; + #$until = str_replace('T', '', $val); + #$until = str_replace('Z', '', $until); + #if (strlen($until) == 8) $until = $until.'235959'; + # UNTIL must be in UTC + $until = date("YmdHis",strtotime($val)); ereg ('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})', $until, $regs); - $until_unixtime = mktime($regs[4],$regs[5],@$regs[6],$regs[2],$regs[3],$regs[1]); + $until_unixtime = mktime($regs[4],$regs[5],@$regs[6],$regs[2],$regs[3],$regs[1]); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = localizeDate($dateFormat_week,$until); break; case 'INTERVAL': -- cgit v1.2.3