aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-24 09:54:28 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-24 09:54:28 +0000
commitdc5600eaf6d6e66a65c8fe84e98c862db28510a1 (patch)
tree670a4231aacb904ae09e5f646bb5e2a61f58e372
parente0e757c985b56ad5968bc1ecc8141da7726241fa (diff)
downloadphpicalendar-dc5600eaf6d6e66a65c8fe84e98c862db28510a1.tar.gz
phpicalendar-dc5600eaf6d6e66a65c8fe84e98c862db28510a1.tar.bz2
phpicalendar-dc5600eaf6d6e66a65c8fe84e98c862db28510a1.zip
fix to use UTC for until
-rw-r--r--calendars/recur_tests/ex_set5.ics1
-rw-r--r--functions/parse/end_vevent.php12
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<br>";
+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':

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