aboutsummaryrefslogtreecommitdiffstats
path: root/functions/ical_parser.php
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2003-09-20 19:13:12 +0000
committerChad Little <clittle@users.sourceforge.net>2003-09-20 19:13:12 +0000
commitfae38172f95e53853037beddd7998af0c676fc3d (patch)
tree0ea7db145df4c3cf9d3293735a99c46328f0339b /functions/ical_parser.php
parent2ba3f29f78b9ee4d3358cf1daa4d1d2431c82aa2 (diff)
downloadphpicalendar-fae38172f95e53853037beddd7998af0c676fc3d.tar.gz
phpicalendar-fae38172f95e53853037beddd7998af0c676fc3d.tar.bz2
phpicalendar-fae38172f95e53853037beddd7998af0c676fc3d.zip
Added BYYEARDAY support, added getdate to switching calendars.
Diffstat (limited to 'functions/ical_parser.php')
-rw-r--r--functions/ical_parser.php25
1 files changed, 21 insertions, 4 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 4a368ab..87d66ab 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -209,10 +209,13 @@ foreach ($cal_filelist as $filename) {
// Handling of the all day events
if ((isset($allday_start) && $allday_start != '')) {
- $start = strtotime($allday_start);
- if (isset($allday_end)) {
- $end = strtotime($allday_end);
- } else {
+ $start = strtotime($allday_start);
+ if ($spans_day) {
+ $allday_end = date('Ymd',$end_unixtime);
+ }
+ if (isset($allday_end)) {
+ $end = strtotime($allday_end);
+ } else {
$end = strtotime('+1 day', $start);
}
if (($end > $mArray_begin) && ($end < $mArray_end)) {
@@ -505,6 +508,19 @@ foreach ($cal_filelist as $filename) {
}
$recur_data[] = $next_date_time;
}
+ foreach ($byyearday as $yearday) {
+ ereg ('([-\+]{0,1})?([0-9]{1,3})', $yearday, $byyearday_arr);
+ if ($byyearday_arr[1] == '-') {
+ $ydtime = mktime(0,0,0,12,31,$this_year);
+ $yearnum = $byyearday_arr[2] - 1;
+ $next_date_time = strtotime('-'.$yearnum.' days', $ydtime);
+ } else {
+ $ydtime = mktime(0,0,0,1,1,$this_year);
+ $yearnum = $byyearday_arr[2] - 1;
+ $next_date_time = strtotime('+'.$yearnum.' days', $ydtime);
+ }
+ $recur_data[] = $next_date_time;
+ }
break;
default:
// anything else we need to end the loop
@@ -740,6 +756,7 @@ foreach ($cal_filelist as $filename) {
if (preg_match("/^DTSTART;VALUE=DATE/i", $field)) {
$allday_start = $data;
$start_date = $allday_start;
+ $start_unixtime = strtotime($data);
} else {
if (preg_match("/^DTSTART;TZID=/i", $field)) {
$tz_tmp = explode('=', $field);

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