Quellcode durchsuchen

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

packProduct
Guillaume vor 3 Jahren
Ursprung
Commit
961f24af0b
1 geänderte Dateien mit 15 neuen und 1 gelöschten Zeilen
  1. +15
    -1
      Solver/Section/OpeningSolver.php

+ 15
- 1
Solver/Section/OpeningSolver.php Datei anzeigen

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

Laden…
Abbrechen
Speichern