Resolve timezone from user browser

This commit is contained in:
Claudio Ortolina
2025-09-11 22:14:15 +03:00
parent c67fd27ea1
commit 21783f5dbf
9 changed files with 23 additions and 10 deletions
+6 -1
View File
@@ -36,7 +36,12 @@ const csrfToken = document
.getAttribute("content");
const liveSocket = new LiveSocket("/live", Socket, {
longPollFallbackMs: 2500,
params: { _csrf_token: csrfToken },
params: (view) => {
return {
_csrf_token: csrfToken,
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
}
},
hooks: { ...Hooks, ...colocatedHooks },
dom: {
onBeforeElUpdated(from, to) {