diff --git a/pkg/server/templates/basepage.templ b/pkg/server/templates/basepage.templ index 436fbd7..fce8514 100644 --- a/pkg/server/templates/basepage.templ +++ b/pkg/server/templates/basepage.templ @@ -25,8 +25,6 @@ templ BasePage(tab int) { - - Converge @@ -46,32 +44,7 @@ templ BasePage(tab int) { - - - -
@@ -106,6 +79,11 @@ templ BasePage(tab int) {
+ + + + + } \ No newline at end of file diff --git a/static/js/timezonehandling.js b/static/js/timezonehandling.js new file mode 100644 index 0000000..3919c33 --- /dev/null +++ b/static/js/timezonehandling.js @@ -0,0 +1,22 @@ + +(() => { + function getTimezone() { + return Intl.DateTimeFormat().resolvedOptions().timeZone; + } + if (!window.originalWebSocket) { + window.originalWebSocket = htmx.createWebSocket + htmx.createWebSocket = function(url) { + url = new URL(url, window.location.href).href + url = url.replace(/^http/, 'ws'); + let modifiedUrl = url + "?timezone=" + getTimezone() + return window.originalWebSocket(modifiedUrl) + } + } + document.body.addEventListener( + "htmx:configRequest", + function(evt) { + //console.log("Adding timezone to htmx request headers and making URL absolute"); + evt.detail.headers["X-Timezone"] = getTimezone(); + } + ); +})()