diff --git a/src/Timespan/Timespan.php b/src/Timespan/Timespan.php index 0d415bf..43d830c 100644 --- a/src/Timespan/Timespan.php +++ b/src/Timespan/Timespan.php @@ -17,13 +17,14 @@ public function __construct(DateTime $start, DateTime $end) } /** - * Check whether timespan contains a date + * Check whether timespan contains a date. + * Includes start, excludes end (like PHP's DatePeriod) * @param DateTime $date * @return boolean */ public function contains(DateTime $date) { - return $this->start < $date && $date < $this->end; + return $this->start <= $date && $date < $this->end; } /**