diff options
author | Chad Little <clittle@users.sourceforge.net> | 2003-11-14 09:30:38 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2003-11-14 09:30:38 +0000 |
commit | afe8351cae7d4cb2515e357a7398a2b35736c63c (patch) | |
tree | 71b192c6fb105446741ea79a24f60e716da086d9 /functions | |
parent | 0d9fd128a50080c04825dfc9dfd5cbba82901b97 (diff) | |
download | phpicalendar-afe8351cae7d4cb2515e357a7398a2b35736c63c.tar.gz phpicalendar-afe8351cae7d4cb2515e357a7398a2b35736c63c.tar.bz2 phpicalendar-afe8351cae7d4cb2515e357a7398a2b35736c63c.zip |
Corrected mistaken duration handling.
Diffstat (limited to 'functions')
-rw-r--r-- | functions/ical_parser.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php index 4780d59..1a8357f 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -116,9 +116,12 @@ foreach ($cal_filelist as $filename) { } elseif ($line == 'END:VEVENT') { - $end_unixtime = $start_unixtime + $the_duration; - $end_time = date ('Hi', $end_unixtime); - + // Handle DURATION + if (!isset($end_unixtime) && isset($the_duration)) { + $end_unixtime = $start_unixtime + $the_duration; + $end_time = date ('Hi', $end_unixtime); + } + // CLASS support if (isset($class)) { if ($class == 'PRIVATE') { @@ -146,11 +149,6 @@ foreach ($cal_filelist as $filename) { if (!isset($start_date)) $start_date = $old_start_date; if (!isset($start_time)) $start_time = $master_array[$old_start_date][$old_start_time][$uid]['event_start']; if (!isset($start_unixtime)) $start_unixtime = $master_array[$old_start_date][$old_start_time][$uid]['start_unixtime']; - // Handle DURATION - if (!isset($end_unixtime) && isset($the_duration)) { - $end_unixtime = $start_unixtime + $the_duration; - $end_time = date ('Hi', $end_unixtime); - } if (!isset($end_unixtime)) $end_unixtime = $master_array[$old_start_date][$old_start_time][$uid]['end_unixtime']; if (!isset($end_time)) $end_time = $master_array[$old_start_date][$old_start_time][$uid]['event_end']; if (!isset($summary)) $summary = $master_array[$old_start_date][$old_start_time][$uid]['event_text']; @@ -872,7 +870,7 @@ foreach ($cal_filelist as $filename) { $end_date = $regs[1] . $regs[2] . $regs[3]; $end_time = $regs[4] . $regs[5]; $end_unixtime = mktime($regs[4], $regs[5], 0, $regs[2], $regs[3], $regs[1]); - + $dlst = date('I', $end_unixtime); $server_offset_tmp = chooseOffset($end_unixtime); if (isset($tz_dtend)) { |