aboutsummaryrefslogtreecommitdiffstats
path: root/functions/date_functions.php
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-26 05:54:46 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-26 05:54:46 +0000
commit7d565474b41400bfce2d665da96d39631458eda3 (patch)
treea0e7a345fb2caeb0eac189b10f2a101a515a2083 /functions/date_functions.php
parent52ba3b8146dd01c1c7d057359f4485aae5813124 (diff)
downloadphpicalendar-7d565474b41400bfce2d665da96d39631458eda3.tar.gz
phpicalendar-7d565474b41400bfce2d665da96d39631458eda3.tar.bz2
phpicalendar-7d565474b41400bfce2d665da96d39631458eda3.zip
fix US holidays; fix 1743686 where byday set and timezone pushes event to different day
Diffstat (limited to 'functions/date_functions.php')
-rw-r--r--functions/date_functions.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/functions/date_functions.php b/functions/date_functions.php
index 07745c1..5239279 100644
--- a/functions/date_functions.php
+++ b/functions/date_functions.php
@@ -209,7 +209,7 @@ $return = "
}
/* Returns an array of the date and time extracted from the data
- passed in. This array contains (unixtime, date, time, allday).
+ passed in. This array contains (unixtime, date, time, allday, tzid).
$data = A string representing a date-time per RFC2445.
$property = The property being examined, e.g. DTSTART, DTEND.
@@ -219,7 +219,6 @@ See:http://phpicalendar.org/documentation/index.php/Property_Value_Data_Types#4.
*/
function extractDateTime($data, $property, $field) {
global $tz_array, $phpiCal_config, $calendar_tz;
-
$allday =''; #suppress error on returning undef.
// Check for zulu time.
$zulu_time = false;
@@ -258,9 +257,11 @@ function extractDateTime($data, $property, $field) {
if (isset($tz_dt)) {
$offset_tmp = chooseOffset($unixtime, $tz_dt);
} elseif (isset($calendar_tz)) {
- $offset_tmp = chooseOffset($unixtime, $calendar_tz);
+ $offset_tmp = chooseOffset($unixtime, $calendar_tz);
+ $tz_dt = $calendar_tz;
} else {
$offset_tmp = $server_offset_tmp;
+ $tz_dt = $phpiCal_config->timezone;
}
// Set the values.
$unixtime = calcTime($offset_tmp, $server_offset_tmp, $unixtime);
@@ -269,7 +270,7 @@ function extractDateTime($data, $property, $field) {
if ($allday == '') $time = date('Hi', $unixtime);
// Return the results.
- return array($unixtime, $date, $time, $allday);
+ return array($unixtime, $date, $time, $allday, $tz_dt);
}
/* TZIDs in calendars often contain leading information that should be stripped

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