From c243d4aafdaea7617b2be768fa34bfb7e50714eb Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Sun, 12 Nov 2006 07:34:34 +0000 Subject: create new date function parse_tz to deal with mozilla and other tzids. Apply to ical_parser --- functions/date_functions.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'functions/date_functions.php') 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; +} + + ?> -- cgit v1.2.3