Skip to content

Commit 372b67b

Browse files
committed
feat: add timezone parameter to LiveSocket initialization
- Included the user's timezone in the LiveSocket parameters to enhance functionality and user experience.
1 parent 5206d30 commit 372b67b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

assets/js/app.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,10 @@ let csrfToken = document
598598
.getAttribute("content");
599599
let liveSocket = new LiveSocket("/live", Socket, {
600600
hooks: { ...Hooks, ...getHooks(Components) },
601-
params: { _csrf_token: csrfToken },
601+
params: {
602+
_csrf_token: csrfToken,
603+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
604+
},
602605
dom: {
603606
onNodeAdded(node) {
604607
if (node instanceof HTMLElement && node.autofocus) {

0 commit comments

Comments
 (0)