From 0e92c9d4bcf6c3fb422493cd6b44eeced1219c06 Mon Sep 17 00:00:00 2001 From: horus Date: Sat, 10 Oct 2020 04:10:12 +0200 Subject: bugfix --- app/Libraries/Zeitumstellung.php | 6 ++++++ config/app.php | 2 +- resources/views/index.blade.php | 2 +- resources/views/layouts/app.blade.php | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Libraries/Zeitumstellung.php b/app/Libraries/Zeitumstellung.php index 42b8415..10bc4cb 100644 --- a/app/Libraries/Zeitumstellung.php +++ b/app/Libraries/Zeitumstellung.php @@ -6,6 +6,8 @@ use Carbon\Carbon; class Zeitumstellung { + // Sommerzeit | Winterzeit + public $season; // full date of the next time change public $date; public $dateText; @@ -51,6 +53,8 @@ class Zeitumstellung { if ( $this->now->lte($this->tc_march) ){ # next time change is in march this year, (last sunday in march) + $this->season = "Sommerzeit"; + $this->date = $this->tc_march; $this->description = 'Die Uhr wird von 2 Uhr auf 3 Uhr vorgestellt, sodass wir 1 Stunde weniger schlafen.'; $this->descriptionHTML = 'Die Uhr wird von 2 Uhr auf 3 Uhr vorgestellt, sodass wir 1 Stunde weniger schlafen.'; @@ -67,6 +71,8 @@ class Zeitumstellung { } else { # next time change is in october this year, (last sunday in october) + $this->season = "Winterzeit"; + $this->date = $this->tc_oct; $this->description = 'Die Uhr wird von 3 Uhr auf 2 Uhr zurückgestellt, sodass wir 1 Stunde länger schlafen.'; $this->descriptionHTML = 'Die Uhr wird von 3 Uhr auf 2 Uhr zurückgestellt, sodass wir 1 Stunde länger schlafen.'; diff --git a/config/app.php b/config/app.php index c9960cd..3bf8946 100644 --- a/config/app.php +++ b/config/app.php @@ -67,7 +67,7 @@ return [ | */ - 'timezone' => 'UTC', + 'timezone' => 'Europe/Berlin', /* |-------------------------------------------------------------------------- diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 8fcae4f..0ac59f6 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -2,7 +2,7 @@ @section('content')
-

Wann ist Zeitumstellung zur Sommerzeit?

+

Wann ist Zeitumstellung zur {{ $tc->season }}?

Nächste Zeitumstellung ist am {{ $tc->day.". ".$tc->monthText." ".$tc->year }}, also in {{ $tc->daysuntil }} Tagen.
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 87f40eb..f7bdf39 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -6,6 +6,7 @@ + {{ config('app.name', 'Laravel') }} @@ -26,9 +27,11 @@ {{ config('app.name', 'Laravel') }} +