/** * Does another range start before this one does? * * @param DateRange $other_range * @return bool True if the other range starts before this one. */ function startsBefore($other_range) { $this_start = $this->getStartDate(); $other_start = $other_range->getStartDate(); return $this_start->before($other_start); }
/** * @param DateRange $dateRange * @return string */ public static function toString(DateRange $dateRange) { return sprintf('[%s,%s]', $dateRange->getStartDate()->format('Y-m-d'), $dateRange->getEndDate()->format('Y-m-d')); }