plugins/calendar plugins/libcalendaring

Thomas Brüderli bruederli at kolabsys.com
Thu Oct 3 10:55:04 CEST 2013


 plugins/calendar/drivers/kolab/kolab_driver.php |    3 +++
 plugins/libcalendaring/libvcalendar.php         |    7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 3c56dcc275f2f6884d1e75bc6f34fa2afc9f0d5c
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Thu Oct 3 10:54:05 2013 +0200

    Ignore _datetime flags when 'allday' property is present; avoid saving them in cache (#2310)

diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 415c8e4..75810b6 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -663,6 +663,9 @@ class kolab_driver extends calendar_driver
           $event['end'] = $master['end'];
         }
 
+        // unset _dateonly flags in (cached) date objects
+        unset($event['start']->_dateonly, $event['end']->_dateonly);
+
         $success = $storage->update_event($event);
         break;
     }
diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index f64a831..c23d40b 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -577,8 +577,9 @@ class libvcalendar
     public static function datetime_prop($name, $dt, $utc = false, $dateonly = null)
     {
         $is_utc = $utc || (($tz = $dt->getTimezone()) && in_array($tz->getName(), array('UTC','GMT','Z')));
+        $is_dateonly = $dateonly === null ? (bool)$dt->_dateonly : (bool)$dateonly;
         $vdt = new VObject\Property\DateTime($name);
-        $vdt->setDateTime($dt, $dt->_dateonly || $dateonly ? VObject\Property\DateTime::DATE :
+        $vdt->setDateTime($dt, $is_dateonly ? VObject\Property\DateTime::DATE :
             ($is_utc ? VObject\Property\DateTime::UTC : VObject\Property\DateTime::LOCALTZ));
         return $vdt;
     }
@@ -682,9 +683,9 @@ class libvcalendar
         if (!empty($event['changed']))
             $ve->add(self::datetime_prop('LAST-MODIFIED', $event['changed'], true));
         if (!empty($event['start']))
-            $ve->add(self::datetime_prop('DTSTART', $event['start'], false, $event['allday']));
+            $ve->add(self::datetime_prop('DTSTART', $event['start'], false, (bool)$event['allday']));
         if (!empty($event['end']))
-            $ve->add(self::datetime_prop('DTEND',   $event['end'], false, $event['allday']));
+            $ve->add(self::datetime_prop('DTEND',   $event['end'], false, (bool)$event['allday']));
         if (!empty($event['due']))
             $ve->add(self::datetime_prop('DUE',   $event['due'], false));
 




More information about the commits mailing list