Skip to content

Instantly share code, notes, and snippets.

@sawirricardo
Created August 4, 2023 03:56
Show Gist options
  • Save sawirricardo/d2a84ec0ae2475c050e51c335323e437 to your computer and use it in GitHub Desktop.
Save sawirricardo/d2a84ec0ae2475c050e51c335323e437 to your computer and use it in GitHub Desktop.
Update timezone using Laravel Livewire Volt
<?php
$updateTimezone = fn($timezone) => session()->put('timezone', $timezone);
?>
<div x-init="$wire.updateTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone)"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment