/** * Determines if the instance is between two others * * @param ChronosInterface $dt1 The instance to compare with. * @param ChronosInterface $dt2 The instance to compare with. * @param bool $equal Indicates if a > and < comparison should be used or <= or >= * @return bool */ public function between(ChronosInterface $dt1, ChronosInterface $dt2, $equal = true) { if ($dt1->gt($dt2)) { $temp = $dt1; $dt1 = $dt2; $dt2 = $temp; } if ($equal) { return $this->gte($dt1) && $this->lte($dt2); } return $this->gt($dt1) && $this->lt($dt2); }