From 3aadaf1c86c00490f40c8f7b62d2d90e50e65bcf Mon Sep 17 00:00:00 2001 From: mitchross Date: Thu, 26 Mar 2026 01:15:28 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20clock=20flickering=20on=20main=20page=20?= =?UTF-8?q?=E2=80=94=20inline=20updateHeaderClock=20was=20using=20UTC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The updateHeaderClock function in index.html was inlined and still using raw UTC (toISOString), while nav.html's version used InterceptTime. Both ran on 1-second intervals updating the same element, causing the clock to rapidly alternate between ET and UTC. Fix: Updated the inline version in index.html to use InterceptTime, matching nav.html. Added _navClockStarted guard and onChange listener so only one interval runs and timezone changes apply instantly. Co-Authored-By: Claude Opus 4.6 (1M context) --- templates/index.html | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/templates/index.html b/templates/index.html index 585d48b..24d7c92 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3816,11 +3816,17 @@ keywords: [] }; - // UTC Clock Update + // Clock Update (uses global InterceptTime for timezone/format) function updateHeaderClock() { const now = new Date(); - const utc = now.toISOString().substring(11, 19); - document.getElementById('headerUtcTime').textContent = utc; + const el = document.getElementById('headerUtcTime'); + const label = document.querySelector('.utc-label'); + if (typeof InterceptTime !== 'undefined') { + if (el) el.textContent = InterceptTime.fullTime(now); + if (label) label.textContent = InterceptTime.getLabel() || 'LOCAL'; + } else { + if (el) el.textContent = now.toISOString().substring(11, 19); + } } function setActiveModeIndicator(label) { @@ -3855,8 +3861,12 @@ } // Update clock every second + window._navClockStarted = true; setInterval(updateHeaderClock, 1000); - updateHeaderClock(); // Initial call + updateHeaderClock(); + if (typeof InterceptTime !== 'undefined' && InterceptTime.onChange) { + InterceptTime.onChange(updateHeaderClock); + } applyKeyboardAccessibility(); // Pager message filter functions