diff options
author | Thomas Bruederli <bruederli@kolabsys.com> | 2013-07-23 08:08:18 (GMT) |
---|---|---|
committer | Thomas Bruederli <bruederli@kolabsys.com> | 2013-07-23 08:08:18 (GMT) |
commit | da3a8a87b78e7d94248571132c39171d53b88436 (patch) | |
tree | dbb0e1c3f1f66fe9c6590c771f433b1ccd9176c0 /lib | |
parent | 8470fba8bef59a6f6e4657b8d70ba63610fa56cc (diff) | |
download | iRony-da3a8a87b78e7d94248571132c39171d53b88436.tar.gz |
Don't adjust end-date in all-day events + sanity-check dates (#2052)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kolab/CalDAV/CalendarBackend.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Kolab/CalDAV/CalendarBackend.php b/lib/Kolab/CalDAV/CalendarBackend.php index 2b8b8b3..16c0b13 100644 --- a/lib/Kolab/CalDAV/CalendarBackend.php +++ b/lib/Kolab/CalDAV/CalendarBackend.php @@ -793,10 +793,19 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend $event['allday'] = true; } - if ($event['allday'] && is_object($event['end'])) { + // shift end-date by one day (except Thunderbird) + if ($event['allday'] && is_object($event['end']) && !$this->useragent == 'lightning') { $event['end']->sub(new \DateInterval('PT23H')); } + // sanity-check and fix end date + if (empty($event['end'])) { + $event['end'] = clone $event['start']; + } + else if ($event['end'] < $event['start']) { + $event['end'] = clone $event['start']; + } + // find alarms if ($valarms = $ve->select('VALARM')) { $action = 'DISPLAY'; |