Fix listing events if using UTC for backend storage.
authorJan Schneider <jan@horde.org>
Mon, 10 May 2010 13:43:54 +0000 (15:43 +0200)
committerJan Schneider <jan@horde.org>
Mon, 10 May 2010 13:43:54 +0000 (15:43 +0200)
kronolith/lib/Driver/Sql.php

index 42929ec..84e725f 100644 (file)
@@ -297,6 +297,16 @@ class Kronolith_Driver_Sql extends Kronolith_Driver
                                             $endInterval = null,
                                             $conditions = '', $vals = array())
     {
+        if ($this->getParam('utc')) {
+            if (!is_null($startInterval)) {
+                $startInterval = clone $startInterval;
+                $startInterval->setTimezone('UTC');
+            }
+            if (!is_null($endInterval)) {
+                $endInterval = clone $endInterval;
+                $endInterval->setTimezone('UTC');
+            }
+        }
         $q = 'SELECT event_id, event_uid, event_description, event_location,' .
             ' event_private, event_status, event_attendees,' .
             ' event_title, event_recurcount, event_url,' .