summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Kolab/CalDAV/CalendarBackend.php11
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';