From 9860f6a01342c00be381d4a25526c20a02903b87 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 5 Oct 2011 11:45:52 +0200 Subject: [PATCH] Expand also has a dtstamp that needs to be set correctly. --- inc/tz/expand.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inc/tz/expand.php b/inc/tz/expand.php index 329ac68d..9fe0edbf 100644 --- a/inc/tz/expand.php +++ b/inc/tz/expand.php @@ -163,7 +163,14 @@ $vtz = new vCalendar($tz->vtimezone); $response = new XMLDocument(array("urn:ietf:params:xml:ns:timezone-service" => "")); $timezones = $response->NewXMLElement('urn:ietf:params:xml:ns:timezone-service:timezones'); -$timezones->NewElement('dtstamp', gmdate('Y-m-d\TH:i:s\Z')); +$qry = new AwlQuery('SELECT to_char(max(last_modified),\'YYYY-MM-DD\"T\"HH24:MI:SS"Z"\') AS dtstamp FROM timezones'); +if ( $qry->Exec('tz/list',__LINE__,__FILE__) && $qry->rows() > 0 ) { + $row = $qry->Fetch(); + $timezones->NewElement('dtstamp', $row->dtstamp); +} +else { + $timezones->NewElement('dtstamp', gmdate('Y-m-d\TH:i:s\Z')); +} $from = new RepeatRuleDateTime($start); $until = new RepeatRuleDateTime($end);