summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Kolab/CalDAV/CalendarBackend.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Kolab/CalDAV/CalendarBackend.php b/lib/Kolab/CalDAV/CalendarBackend.php
index 510ddba..17eba73 100644
--- a/lib/Kolab/CalDAV/CalendarBackend.php
+++ b/lib/Kolab/CalDAV/CalendarBackend.php
@@ -558,8 +558,12 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
if ($filter['name'] != 'VEVENT')
continue;
if (is_array($filter['time-range'])) {
- $query[] = array('dtstart', '<=', $filter['time-range']['end']);
- $query[] = array('dtend', '>=', $filter['time-range']['start']);
+ if (!empty($filter['time-range']['end'])) {
+ $query[] = array('dtstart', '<=', $filter['time-range']['end']);
+ }
+ if (!empty($filter['time-range']['start'])) {
+ $query[] = array('dtend', '>=', $filter['time-range']['start']);
+ }
}
}