aboutsummaryrefslogtreecommitdiffstats
path: root/functions/date_functions.php
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2006-11-12 07:34:34 +0000
committerJim Hu <jimhu@users.sourceforge.net>2006-11-12 07:34:34 +0000
commitc243d4aafdaea7617b2be768fa34bfb7e50714eb (patch)
tree9b0ba71361ce75e75df1785b5384557e1a75bef9 /functions/date_functions.php
parent487b3910ebb1feed890ce8dd52217304eed37435 (diff)
downloadphpicalendar-c243d4aafdaea7617b2be768fa34bfb7e50714eb.tar.gz
phpicalendar-c243d4aafdaea7617b2be768fa34bfb7e50714eb.tar.bz2
phpicalendar-c243d4aafdaea7617b2be768fa34bfb7e50714eb.zip
create new date function parse_tz to deal with mozilla and other tzids. Apply to ical_parser
Diffstat (limited to 'functions/date_functions.php')
-rw-r--r--functions/date_functions.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/functions/date_functions.php b/functions/date_functions.php
index c6901d0..9c9bc30 100644
--- a/functions/date_functions.php
+++ b/functions/date_functions.php
@@ -287,4 +287,17 @@ function extractDateTime($data, $property, $field) {
// Return the results.
return array($unixtime, $date, $time, $allday);
}
+
+//TZIDs in calendars often contain leading information that should be stripped
+//Example: TZID=/mozilla.org/20050126_1/Europe/Berlin
+//Need to return the last part only
+function parse_tz($data){
+ $fields = explode("/",$data);
+ $tz = array_pop($fields);
+ $tmp = array_pop($fields);
+ if (isset($tmp) && $tmp != "") $tz = "$tmp/$tz";
+ return $tz;
+}
+
+
?>

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