summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-07-23 08:27:44 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-07-23 08:27:44 (GMT)
commit9534fa2b9f0d63a7979b7fccf7514832ed9c36d5 (patch)
tree4a0dac92bb48c1e17bef0c0d686e74895f07ec2f
parentda3a8a87b78e7d94248571132c39171d53b88436 (diff)
downloadiRony-9534fa2b9f0d63a7979b7fccf7514832ed9c36d5.tar.gz
Correctly adjust end of all-day events from internal format
-rw-r--r--lib/Kolab/CalDAV/CalendarBackend.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Kolab/CalDAV/CalendarBackend.php b/lib/Kolab/CalDAV/CalendarBackend.php
index 16c0b13..d858b4d 100644
--- a/lib/Kolab/CalDAV/CalendarBackend.php
+++ b/lib/Kolab/CalDAV/CalendarBackend.php
@@ -793,8 +793,8 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
$event['allday'] = true;
}
- // shift end-date by one day (except Thunderbird)
- if ($event['allday'] && is_object($event['end']) && !$this->useragent == 'lightning') {
+ // shift end-date by one day
+ if ($event['allday'] && is_object($event['end'])) {
$event['end']->sub(new \DateInterval('PT23H'));
}
@@ -860,6 +860,13 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
$ve = VObject\Component::create($this->type_component_map[$type]);
$ve->add('UID', $event['uid']);
+ // all-day events end the next day
+ if ($event['allday'] && !empty($event['end'])) {
+ $event['end'] = clone $event['end'];
+ $event['end']->add(new \DateInterval('P1D'));
+ $event['end']->_dateonly = true;
+ }
+
if (!empty($event['created']))
$ve->add(VObjectUtils::datetime_prop('CREATED', $event['created'], true));
if (!empty($event['changed']))