aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2003-09-21 20:02:54 +0000
committerChad Little <clittle@users.sourceforge.net>2003-09-21 20:02:54 +0000
commita2c7458c98dd67894a68bc636a2808263e9feb63 (patch)
tree2a0e403d844b185fb8ef071c0e1f9c7a73906eb5 /functions
parent25a8e1aa72d2cd919307492d220d99336bae7d11 (diff)
downloadphpicalendar-a2c7458c98dd67894a68bc636a2808263e9feb63.tar.gz
phpicalendar-a2c7458c98dd67894a68bc636a2808263e9feb63.tar.bz2
phpicalendar-a2c7458c98dd67894a68bc636a2808263e9feb63.zip
Added a fix for when peeps write calendar start times before 1970 (when
unix started).
Diffstat (limited to 'functions')
-rw-r--r--functions/ical_parser.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 40e377d..8895b88 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -387,6 +387,7 @@ foreach ($cal_filelist as $filename) {
break;
case 'END':
+ if (!isset($number)) $number = 1;
// if $until isn't set yet, we set it to the end of our range we're looking at
// The FREQ switch array will always kick our early, so lets try this workaround.
if (isset($until)) $until = strtotime('+'.$interval.' '.$freq_type, $until);;
@@ -494,7 +495,11 @@ foreach ($cal_filelist as $filename) {
}
break;
case 'YEARLY':
- if (!isset($bymonth)) $bymonth[] = date('m', $start_date_time);
+
+ if (!isset($bymonth)) {
+ $m = date('m', $start_date_time);
+ $bymonth = array("$m");
+ }
foreach($bymonth as $month) {
$year = date('Y', $next_range_time);
if ((isset($byday)) && (is_array($byday))) {
@@ -764,6 +769,11 @@ foreach ($cal_filelist as $filename) {
$data = ereg_replace('Z', '', $data);
$field = ereg_replace(';VALUE=DATE-TIME', '', $field);
if (preg_match("/^DTSTART;VALUE=DATE/i", $field)) {
+ ereg ('([0-9]{4})([0-9]{2})([0-9]{2})', $data, $dtstart_check);
+ if ($dtstart_check[1] < 1969) {
+ $dtstart_check[1] = '1990';
+ $data = $dtstart_check[1].$dtstart_check[2].$dtstart_check[3];
+ }
$allday_start = $data;
$start_date = $allday_start;
$start_unixtime = strtotime($data);

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