mirror of
https://github.com/werkraum-media/thuecat.git
synced 2024-09-28 19:26:11 +02:00
Assume default timezone if not provided.
Data is coming from Germany and affects German places only. We therefore expect German timezone.
This commit is contained in:
parent
265cb27236
commit
73db8b5d9d
1 changed files with 2 additions and 2 deletions
|
@ -71,12 +71,12 @@ class OpeningHour
|
||||||
{
|
{
|
||||||
$from = null;
|
$from = null;
|
||||||
if (isset($rawData['from'])) {
|
if (isset($rawData['from'])) {
|
||||||
$timeZone = new \DateTimeZone($rawData['from']['timezone']);
|
$timeZone = new \DateTimeZone($rawData['from']['timezone'] ?? 'Europe/Berlin');
|
||||||
$from = new \DateTimeImmutable($rawData['from']['date'], $timeZone);
|
$from = new \DateTimeImmutable($rawData['from']['date'], $timeZone);
|
||||||
}
|
}
|
||||||
$through = null;
|
$through = null;
|
||||||
if (isset($rawData['through'])) {
|
if (isset($rawData['through'])) {
|
||||||
$timeZone = new \DateTimeZone($rawData['through']['timezone']);
|
$timeZone = new \DateTimeZone($rawData['through']['timezone'] ?? 'Europe/Berlin');
|
||||||
$through = new \DateTimeImmutable($rawData['through']['date'], $timeZone);
|
$through = new \DateTimeImmutable($rawData['through']['date'], $timeZone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue