namespace OCA\DAV\CalDAV;
+use DateTime;
use OCA\DAV\DAV\Sharing\IShareable;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCA\DAV\Connector\Sabre\Principal;
return $this->userDisplayNames[$uid];
}
-
+
/**
* @return array
*/
->from('calendarobjects', 'c');
if (isset($options['timerange'])) {
- if (isset($options['timerange']['start'])) {
+ if (isset($options['timerange']['start']) && $options['timerange']['start'] instanceof DateTime) {
$outerQuery->andWhere($outerQuery->expr()->gt('lastoccurence',
$outerQuery->createNamedParameter($options['timerange']['start']->getTimeStamp())));
}
- if (isset($options['timerange']['end'])) {
+ if (isset($options['timerange']['end']) && $options['timerange']['end'] instanceof DateTime) {
$outerQuery->andWhere($outerQuery->expr()->lt('firstoccurence',
$outerQuery->createNamedParameter($options['timerange']['end']->getTimeStamp())));
}
}
} else {
$it = new EventIterator($vObject, (string)$component->UID);
- $maxDate = new \DateTime(self::MAX_DATE);
+ $maxDate = new DateTime(self::MAX_DATE);
if ($it->isInfinite()) {
$lastOccurrence = $maxDate->getTimestamp();
} else {