3 namespace Sabre\VObject\Component;
10 * This component contains some additional functionality specific for VJOURNALs.
12 * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
13 * @author Evert Pot (http://www.rooftopsolutions.nl/)
14 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
16 class VJournal extends VObject\Component {
19 * Returns true or false depending on if the event falls in the specified
20 * time-range. This is used for filtering purposes.
22 * The rules used to determine if an event falls within the specified
23 * time-range is based on the CalDAV specification.
25 * @param DateTime $start
26 * @param DateTime $end
29 public function isInTimeRange(\DateTime $start, \DateTime $end) {
31 $dtstart = isset($this->DTSTART)?$this->DTSTART->getDateTime():null;
33 $effectiveEnd = clone $dtstart;
34 if ($this->DTSTART->getDateType() == VObject\Property\DateTime::DATE) {
35 $effectiveEnd->modify('+1 day');
38 return ($start <= $effectiveEnd && $end > $dtstart);