From 072411a304c7d8229d9c89db01d8974a85dd9853 Mon Sep 17 00:00:00 2001 From: meeki007 <5952964+meeki007@users.noreply.github.com> Date: Mon, 31 Jul 2023 04:34:09 -0400 Subject: [PATCH] Update worldmap.js - add clientTimezone (#245) Add clientTimezone to the 'connected' msg.payload If unable to complete query return bool of 'false' Why? Many clients connect to the world map from different locals. Knowing what time their browser/computer is using allows us to format events to their timezone. Overhead is minimal as it only is queried once when they connect. --- worldmap/worldmap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldmap/worldmap.js b/worldmap/worldmap.js index fa6bf6f..7dbd994 100644 --- a/worldmap/worldmap.js +++ b/worldmap/worldmap.js @@ -63,7 +63,7 @@ var connect = function() { if (!inIframe) { document.getElementById("footer").innerHTML = ""+pagefoot+""; } - ws.send(JSON.stringify({action:"connected",parameters:Object.fromEntries((new URL(location)).searchParams)})); + ws.send(JSON.stringify({action:"connected",parameters:Object.fromEntries((new URL(location)).searchParams),clientTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone || false})); onoffline(); }; ws.onclose = function() {