@@ -44,7 +44,21 @@ class OpeningSolver | |||
protected function isOpeningDay(int $weekDay, array $openings): bool | |||
{ | |||
return (bool) $this->getOpeningByWeekday($weekDay, $openings); | |||
$opening = $this->getOpeningByWeekday($weekDay, $openings); | |||
if($opening) { | |||
$now = new \DateTime(); | |||
if($weekDay == $now->format('N')) { | |||
if($now < $opening->getTimeEnd()) { | |||
return true; | |||
} | |||
} | |||
else { | |||
return true; | |||
} | |||
} | |||
return false; | |||
} | |||
protected function isClosingDay(int $weekDay, array $openings): bool |