Bläddra i källkod

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

packProduct
Guillaume 3 år sedan
förälder
incheckning
961f24af0b
1 ändrade filer med 15 tillägg och 1 borttagningar
  1. +15
    -1
      Solver/Section/OpeningSolver.php

+ 15
- 1
Solver/Section/OpeningSolver.php Visa fil

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

Laddar…
Avbryt
Spara