lib/kolab_sync_data_calendar.php

Aleksander Machniak machniak at kolabsys.com
Thu Jan 10 20:15:08 CET 2013


 lib/kolab_sync_data_calendar.php |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit f6b0f309ae3552d34d29183e0c49498ad1336ec4
Author: Aleksander Machniak <alec at alec.pl>
Date:   Thu Jan 10 20:14:20 2013 +0100

    Add workaround for Android issue where all-day event becomes a 24-hour event

diff --git a/lib/kolab_sync_data_calendar.php b/lib/kolab_sync_data_calendar.php
index 64f702d..60f7d07 100644
--- a/lib/kolab_sync_data_calendar.php
+++ b/lib/kolab_sync_data_calendar.php
@@ -402,6 +402,16 @@ class kolab_sync_data_calendar extends kolab_sync_data
             $this->setKolabDataItem($event, $name, $value);
         }
 
+        // Try to fix allday events from Android
+        // It doesn't set all-day flag but the period is a whole day
+        if (!$event['allday'] && $event['end'] && $event['start']) {
+            $interval = @date_diff($event['start'], $event['end']);
+            if ($interval && $interval->format('%y%m%d%h%i%s') == '001000') {
+                $event['allday'] = 1;
+                $event['end']    = clone $event['start'];
+            }
+        }
+
         // Reminder
         // @TODO: should alarms be used when importing event from phone?
         if ($config['ALARMS']) {





More information about the commits mailing list