|
33 | 33 |
|
34 | 34 | namespace OCA\DAV\CalDAV; |
35 | 35 |
|
| 36 | +use DateTime; |
36 | 37 | use OCA\DAV\Connector\Sabre\Principal; |
37 | 38 | use OCA\DAV\DAV\Sharing\Backend; |
38 | 39 | use OCA\DAV\DAV\Sharing\IShareable; |
@@ -1551,14 +1552,14 @@ public function search(array $calendarInfo, $pattern, array $searchProperties, |
1551 | 1552 | ->from('calendarobjects', 'c'); |
1552 | 1553 |
|
1553 | 1554 | if (isset($options['timerange'])) { |
1554 | | - if (isset($options['timerange']['start'])) { |
| 1555 | + if (isset($options['timerange']['start']) && $options['timerange']['start'] instanceof DateTime) { |
1555 | 1556 | $outerQuery->andWhere($outerQuery->expr()->gt('lastoccurence', |
1556 | | - $outerQuery->createNamedParameter($options['timerange']['start']->getTimeStamp))); |
| 1557 | + $outerQuery->createNamedParameter($options['timerange']['start']->getTimeStamp()))); |
1557 | 1558 |
|
1558 | 1559 | } |
1559 | | - if (isset($options['timerange']['end'])) { |
| 1560 | + if (isset($options['timerange']['end']) && $options['timerange']['end'] instanceof DateTime) { |
1560 | 1561 | $outerQuery->andWhere($outerQuery->expr()->lt('firstoccurence', |
1561 | | - $outerQuery->createNamedParameter($options['timerange']['end']->getTimeStamp))); |
| 1562 | + $outerQuery->createNamedParameter($options['timerange']['end']->getTimeStamp()))); |
1562 | 1563 | } |
1563 | 1564 | } |
1564 | 1565 |
|
@@ -2258,7 +2259,7 @@ public function getDenormalizedData($calendarData) { |
2258 | 2259 | } |
2259 | 2260 | } else { |
2260 | 2261 | $it = new EventIterator($vObject, (string)$component->UID); |
2261 | | - $maxDate = new \DateTime(self::MAX_DATE); |
| 2262 | + $maxDate = new DateTime(self::MAX_DATE); |
2262 | 2263 | if ($it->isInfinite()) { |
2263 | 2264 | $lastOccurrence = $maxDate->getTimestamp(); |
2264 | 2265 | } else { |
|
0 commit comments