Fix timezone
This commit is contained in:
parent
e37c663c43
commit
c3ea5447e7
2 changed files with 5 additions and 4 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
use DateTimeZone;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\View\Component;
|
use Illuminate\View\Component;
|
||||||
|
|
||||||
|
|
@ -42,13 +43,13 @@ public function isItChristmas() : bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isItAprilFools() : bool {
|
public function isItAprilFools() : bool {
|
||||||
$currentDate = new DateTime();
|
$tz = new DateTimeZone("Europe/London");
|
||||||
|
$currentDate = new DateTime("now", $tz);
|
||||||
$currentDate->setTime(0, 0);
|
$currentDate->setTime(0, 0);
|
||||||
$currentYear = intval($currentDate->format('Y'));
|
$currentYear = intval($currentDate->format('Y'));
|
||||||
|
|
||||||
$aprilFools = new DateTime("$currentYear-04-01");
|
$aprilFools = new DateTime("$currentYear-04-01", $tz);
|
||||||
|
|
||||||
return $currentDate == $aprilFools;
|
return $currentDate == $aprilFools;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'name' => env('APP_NAME', 'wah.moe'),
|
'name' => env('APP_NAME', 'wah.moe'),
|
||||||
'version' => '2026.03.31',
|
'version' => '2026.03.31-patch0',
|
||||||
'env' => env('APP_ENV', 'production'),
|
'env' => env('APP_ENV', 'production'),
|
||||||
'debug' => (bool)env('APP_DEBUG', false),
|
'debug' => (bool)env('APP_DEBUG', false),
|
||||||
'url' => env('APP_URL', 'http://localhost'),
|
'url' => env('APP_URL', 'http://localhost'),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue