From a3bd3d06d1390fcc24bf00706cf54d13189b3e2f Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 23 Feb 2026 01:06:48 +0700 Subject: [PATCH] Add local and UTC clocks below header, updated every second --- src/main.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main.js b/src/main.js index bf127b3..926e89a 100644 --- a/src/main.js +++ b/src/main.js @@ -459,6 +459,9 @@ function buildUI(state) { History: ${CONFIG.historyDuration}s | Running

+

+ | +

Waiting for data...
@@ -721,6 +724,16 @@ async function init() { .getElementById("pause-btn") .addEventListener("click", () => togglePause(state)); + function updateClocks() { + const now = new Date(); + const utc = now.toISOString().replace(/\.\d{3}Z$/, "Z"); + const local = now.toLocaleString("sv-SE", { hour12: false }); + document.getElementById("clock-local").textContent = "Local: " + local; + document.getElementById("clock-utc").textContent = "UTC: " + utc; + } + updateClocks(); + setInterval(updateClocks, 1000); + tick(state); setInterval(() => tick(state), CONFIG.updateInterval);