Open GrupoWebex opened 5 years ago
public function isBetween($minDateTime, $maxDateTime, $closed = true, $period = 'seconds')
{
$isBefore = $this->isBefore($maxDateTime, $period);
$isAfter = $this->isAfter($minDateTime, $period);
// include endpoints
if ($closed === true)
{
$isSameMin = $this->isSame($minDateTime, $period);
$isSameMax = $this->isSame($maxDateTime, $period);
return $isSameMin === true || $isSameMax === true
|| ($isBefore === true && $isAfter === true);
}
return $isBefore === true && $isAfter === true;
}
Update through composer, i my code stop working cause you dont fix this bug. Please, update on main branch.
Is before = date is before MAXdate, not MINdate Is After = date is after MINdate, not MAXdate
If you include endpoints ($closed = true), have to check if date is same as MINdate if date is same as MAXdate then return $isSameMin === true || $isSameMax === true || ($isBefore === true && $isAfter === true);