diff --git a/app/Livewire/Project/Shared/ScheduledTask/Executions.php b/app/Livewire/Project/Shared/ScheduledTask/Executions.php index 7a2e14e89..3ee053e3e 100644 --- a/app/Livewire/Project/Shared/ScheduledTask/Executions.php +++ b/app/Livewire/Project/Shared/ScheduledTask/Executions.php @@ -7,8 +7,8 @@ use Livewire\Component; class Executions extends Component { public $executions = []; - public $selectedKey; + public $task; public function getListeners() { @@ -26,4 +26,12 @@ class Executions extends Component } $this->selectedKey = $key; } -} + + public function getServerTimezone() + { + $server = data_get($this, 'destination.server'); + $serverTimezone = $server->settings->server_timezone; + ray('Server Timezone:', $serverTimezone); + return $serverTimezone; + } +} \ No newline at end of file diff --git a/resources/views/livewire/project/shared/scheduled-task/executions.blade.php b/resources/views/livewire/project/shared/scheduled-task/executions.blade.php index afbf1ea93..cf7a591d7 100644 --- a/resources/views/livewire/project/shared/scheduled-task/executions.blade.php +++ b/resources/views/livewire/project/shared/scheduled-task/executions.blade.php @@ -24,9 +24,25 @@ @endif
Status: {{ data_get($execution, 'status') }}
-
Started At: {{ data_get($execution, 'created_at') }}
+
Started At: + @php + $createdAt = data_get($execution, 'created_at', now()); + $serverTimezone = $this->getServerTimezone(); + ray('Created At:', $createdAt, 'Server Timezone:', $serverTimezone); + + $date = new DateTime($createdAt); + if ($serverTimezone) { + try { + $date->setTimezone(new DateTimeZone($serverTimezone)); + } catch (\Exception $e) { + ray('Invalid timezone:', $serverTimezone); + } + } + echo $date->format('Y-m-d H:i:s T'); + @endphp +
@empty
No executions found.
@endforelse - + \ No newline at end of file diff --git a/resources/views/livewire/project/shared/scheduled-task/show.blade.php b/resources/views/livewire/project/shared/scheduled-task/show.blade.php index b69463a0e..d448000ca 100644 --- a/resources/views/livewire/project/shared/scheduled-task/show.blade.php +++ b/resources/views/livewire/project/shared/scheduled-task/show.blade.php @@ -42,6 +42,6 @@

Recent executions (click to check output)

- +
- + \ No newline at end of file