aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2003-11-05 05:31:03 +0000
committerChad Little <clittle@users.sourceforge.net>2003-11-05 05:31:03 +0000
commitcfe612487b6f3266d91cd168bcbdae51f30fa1e4 (patch)
tree7c6c58e01a935813dfbe93e834f4db9d92da5102 /functions
parent05772677bb7942b371cd7e47c12880609d1284e8 (diff)
downloadphpicalendar-cfe612487b6f3266d91cd168bcbdae51f30fa1e4.tar.gz
phpicalendar-cfe612487b6f3266d91cd168bcbdae51f30fa1e4.tar.bz2
phpicalendar-cfe612487b6f3266d91cd168bcbdae51f30fa1e4.zip
Applied 2 patches.
Diffstat (limited to 'functions')
-rw-r--r--functions/ical_parser.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index d83f84d..b76297c 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -143,6 +143,11 @@ 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'];
@@ -657,6 +662,8 @@ foreach ($cal_filelist as $filename) {
if (preg_match("/^DUE;VALUE=DATE/i", $field)) {
$allday_start = $data;
$start_date = $allday_start;
+ $start_unixtime = strtotime($data);
+ $due_date = date('Ymd', $start_unixtime);
} else {
if (preg_match("/^DUE;TZID=/i", $field)) {
$tz_tmp = explode('=', $field);
@@ -954,8 +961,9 @@ foreach ($cal_filelist as $filename) {
$minutes = ereg_replace('M', '', $duration[5]);
$seconds = ereg_replace('S', '', $duration[6]);
$the_duration = ($weeks * 60 * 60 * 24 * 7) + ($days * 60 * 60 * 24) + ($hours * 60 * 60) + ($minutes * 60) + ($seconds);
- $end_unixtime = $start_unixtime + $the_duration;
- $end_time = date ('Hi', $end_unixtime);
+ // Do this in the END:VEVENT now so that it doesn't have to come after DTSTART
+ //$end_unixtime = $start_unixtime + $the_duration;
+ //$end_time = date ('Hi', $end_unixtime);
$first_duration = FALSE;
}
break;

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