From 3dd202a8c4564442a623945213e53aa9fc70589a Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 28 Feb 2011 14:52:49 +0000 Subject: Fix ICS date format without time --- it.class | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'it.class') diff --git a/it.class b/it.class index cc7650b..2978978 100644 --- a/it.class +++ b/it.class @@ -712,17 +712,13 @@ static function date($format = "", $stamp = null) "date:en" => "m/d/Y", "datetime:en" => "m/d/Y h:ia", "time:en" => "h:ia", + "icsdate" => "Ymd", ); if (!($formatstring = $formats["$name:$language"]) && !($formatstring = $formats[$name])) { - if (it::match('^icsdate', $format)) # Special icsdate or icsdatetime format? Use UTC time format for Google Calendar to be happy - { - if ($format == "icsdate") - return date("Ymd", $stamp) . "Z"; # MUST NOT use gmdate! - else - return gmdate("Ymd", $stamp) . "T" . gmdate("His", $stamp) . "Z"; - } + if ($format == "icsdatetime") # Special icsdate or icsdatetime format? Use UTC time format for Google Calendar to be happy + return gmdate("Ymd", $stamp) . "T" . gmdate("His", $stamp) . "Z"; else $formatstring = $format; } -- cgit v1.2.3