Browse Source

[Frontend] Horaires : problème de date de réouverture le lundi

packProduct
Guillaume 3 years ago
parent
commit
961f24af0b
1 changed files with 15 additions and 1 deletions
  1. +15
    -1
      Solver/Section/OpeningSolver.php

+ 15
- 1
Solver/Section/OpeningSolver.php View File

@@ -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

Loading…
Cancel
Save