Example #1
0
 /**
  * Checks if the given date is included in the range.
  *
  * @param   Date  $date  The date to compare to.
  *
  * @return  boolean
  *
  * @since   2.0.0
  */
 public function includes(Date $date)
 {
     return $this->range->includes(new DateTime($date));
 }
Example #2
0
 /**
  * Checks if ranges overlap with each other.
  *
  * @param   DateTimeRange  $range  The range to compare to.
  *
  * @return  boolean
  *
  * @since   2.0.0
  */
 public function overlaps(DateTimeRange $range)
 {
     return $range->includes($this->start) || $range->includes($this->end) || $this->includesRange($range);
 }