Path: blob/master/src/applications/calendar/parser/data/PhutilCalendarRecurrenceList.php
12262 views
<?php12final class PhutilCalendarRecurrenceList3extends PhutilCalendarRecurrenceSource {45private $dates = array();6private $order;78public function setDates(array $dates) {9assert_instances_of($dates, 'PhutilCalendarDateTime');10$this->dates = $dates;11return $this;12}1314public function getDates() {15return $this->dates;16}1718public function resetSource() {19foreach ($this->getDates() as $date) {20$date->setViewerTimezone($this->getViewerTimezone());21}2223$order = msort($this->getDates(), 'getEpoch');24$order = array_reverse($order);25$this->order = $order;2627return $this;28}2930public function getNextEvent($cursor) {31while ($this->order) {32$next = array_pop($this->order);33if ($next->getEpoch() >= $cursor) {34return $next;35}36}3738return null;39}404142}434445