Пример #1
0
 /**
  * Checks if current position is valid.
  *
  * @return  boolean
  *
  * @since   2.0.0
  */
 public function valid()
 {
     return !$this->current->isAfter($this->end);
 }
Пример #2
0
 /**
  * Checks if the current date is after the date given as parameter.
  *
  * @param   Date  $date  The date to compare to.
  *
  * @return  boolean
  *
  * @since   2.0.0
  */
 public function isAfter(Date $date)
 {
     return $this->datetime->isAfter($date->datetime);
 }
Пример #3
0
 /**
  * Checks if the given date is included in the range.
  *
  * @param   DateTime  $datetime  The date to compare to.
  *
  * @return  boolean
  *
  * @since   2.0.0
  */
 public function includes(DateTime $datetime)
 {
     return !$datetime->isBefore($this->start) && !$datetime->isAfter($this->end);
 }