-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Chore] Added page to debug time zone issue (#946)
- Loading branch information
1 parent
e8b57b2
commit c09337e
Showing
8 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Debug; | ||
|
||
use App\Settings\GeneralSettings; | ||
use Livewire\Attributes\Layout; | ||
use Livewire\Component; | ||
|
||
#[Layout('layouts.debug')] | ||
class Timezone extends Component | ||
{ | ||
public $settings; | ||
|
||
public function mount() | ||
{ | ||
$settings = new GeneralSettings(); | ||
|
||
$this->settings = $settings->toArray(); | ||
} | ||
|
||
public function render() | ||
{ | ||
return view('livewire.debug.timezone'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace App\View\Components; | ||
|
||
use Closure; | ||
use Illuminate\Contracts\View\View; | ||
use Illuminate\View\Component; | ||
|
||
class DebugLayout extends Component | ||
{ | ||
/** | ||
* Get the view / contents that represent the component. | ||
*/ | ||
public function render(): View|Closure|string | ||
{ | ||
return view('layouts.app'); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
public/build/assets/app-a1b0d14f.css → public/build/assets/app-2a095b76.css
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="h-full"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<title>Timezone - {{ config('app.name') }}</title> | ||
|
||
{{-- Fonts --}} | ||
<link href="{{ asset('fonts/inter/inter.css') }}" rel="stylesheet" /> | ||
|
||
{{-- Styles --}} | ||
@filamentStyles | ||
@vite('resources/css/app.css') | ||
</head> | ||
<body class="min-h-screen antialiased bg-gray-50 text-gray-950"> | ||
<main class="max-w-xl p-4 mx-auto space-y-4 sm:p-6 lg:p-8 sm:space-y-8"> | ||
@if (isset($header)) | ||
{{ $header }} | ||
@endif | ||
|
||
{{ $slot }} | ||
</main> | ||
|
||
{{-- Scripts --}} | ||
@filamentScripts | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<div wire:poll.1s> | ||
<x-slot name="header"> | ||
<header> | ||
<div> | ||
<h1 class="text-xl font-bold tracking-tight text-gray-950 sm:text-2xl">Debug Time Zone - {{ config('app.name') }}</h1> | ||
|
||
<p class="mt-1 text-sm font-medium"> | ||
The purpose of this page is to help debut the current issues around time zones and local time. The table below displays an output of the applications current configuration. | ||
</p> | ||
</div> | ||
</header> | ||
</x-slot> | ||
|
||
<div class="space-y-6"> | ||
<div class="overflow-hidden bg-white shadow sm:rounded-md"> | ||
<div class="p-4 bg-white border-b border-gray-200 sm:px-6"> | ||
<h3 class="text-base font-semibold leading-6 text-gray-900">Timezone</h3> | ||
</div> | ||
|
||
<ul role="list" class="divide-y divide-gray-200"> | ||
<li class="px-4 py-4 sm:px-6"> | ||
<p class="text-sm font-medium text-gray-900">PHP time zone</p> | ||
<p class="text-sm text-gray-500 truncate">{{ date_default_timezone_get() }}</p> | ||
</li> | ||
|
||
<li class="px-4 py-4 sm:px-6"> | ||
<p class="text-sm font-medium text-gray-900">App time zone</p> | ||
<p class="text-sm text-gray-500 truncate">{{ config('app.timezone') }}</p> | ||
</li> | ||
|
||
<li class="px-4 py-4 sm:px-6"> | ||
<p class="text-sm font-medium text-gray-900">Settings time zone</p> | ||
<p class="text-sm text-gray-500 truncate">{{ $settings['timezone'] }} ({{ \Carbon\Carbon::create($settings['timezone'])->format('P') }})</p> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="overflow-hidden bg-white shadow sm:rounded-md"> | ||
<div class="p-4 bg-white border-b border-gray-200 sm:px-6"> | ||
<h3 class="text-base font-semibold leading-6 text-gray-900">Time</h3> | ||
</div> | ||
|
||
<ul role="list" class="divide-y divide-gray-200"> | ||
<li class="px-4 py-4 sm:px-6"> | ||
<p class="text-sm font-medium text-gray-900">UTC time</p> | ||
<p class="text-sm text-gray-500 truncate">{{ \Carbon\Carbon::now() }}</p> | ||
</li> | ||
|
||
<li class="px-4 py-4 sm:px-6"> | ||
<p class="text-sm font-medium text-gray-900">Local time</p> | ||
<p class="text-sm text-gray-500 truncate">{{ \Carbon\Carbon::now()->timezone($settings['timezone'] ?? 'UTC') }}</p> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
use App\Livewire\Debug\Timezone as DebugTimezone; | ||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::get('/debug/timezone', DebugTimezone::class) | ||
->name('debug.timezone'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters