Fix timezone

This commit is contained in:
Roscoe 2026-04-01 00:14:44 +01:00
commit c3ea5447e7
Signed by: RoscoeDaWah
SSH key fingerprint: SHA256:Hqn452XQ1ETzUt/FthJu6+OFkS4NBxCv5VQSEvuk7CE
2 changed files with 5 additions and 4 deletions

View file

@ -4,6 +4,7 @@
use Closure;
use DateTime;
use DateTimeZone;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
@ -42,13 +43,13 @@ public function isItChristmas() : bool {
}
public function isItAprilFools() : bool {
$currentDate = new DateTime();
$tz = new DateTimeZone("Europe/London");
$currentDate = new DateTime("now", $tz);
$currentDate->setTime(0, 0);
$currentYear = intval($currentDate->format('Y'));
$aprilFools = new DateTime("$currentYear-04-01");
$aprilFools = new DateTime("$currentYear-04-01", $tz);
return $currentDate == $aprilFools;
}
}