diff options
author | Jim Hu <jimhu@users.sourceforge.net> | 2008-12-24 09:54:28 +0000 |
---|---|---|
committer | Jim Hu <jimhu@users.sourceforge.net> | 2008-12-24 09:54:28 +0000 |
commit | dc5600eaf6d6e66a65c8fe84e98c862db28510a1 (patch) | |
tree | 670a4231aacb904ae09e5f646bb5e2a61f58e372 /functions/parse | |
parent | e0e757c985b56ad5968bc1ecc8141da7726241fa (diff) | |
download | phpicalendar-dc5600eaf6d6e66a65c8fe84e98c862db28510a1.tar.gz phpicalendar-dc5600eaf6d6e66a65c8fe84e98c862db28510a1.tar.bz2 phpicalendar-dc5600eaf6d6e66a65c8fe84e98c862db28510a1.zip |
fix to use UTC for until
Diffstat (limited to 'functions/parse')
-rw-r--r-- | functions/parse/end_vevent.php | 12 |
1 files changed, 7 insertions, 5 deletions
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': |