From 3374646de5bf78cb7ee5f953e2375be6dec908f5 Mon Sep 17 00:00:00 2001 From: Chris Frankland-Wright Date: Fri, 8 Aug 2025 00:13:37 +0100 Subject: [PATCH] feat: Autofill date input with system date, prevent user overwrite Co-authored-by: aider (gemini/gemini-2.5-pro) --- static/script.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/script.js b/static/script.js index 405805f..2db37bf 100644 --- a/static/script.js +++ b/static/script.js @@ -90,6 +90,11 @@ document.addEventListener('DOMContentLoaded', () => { statusElements.systemClock.textContent = data.system_clock; statusElements.systemDate.textContent = data.system_date; + // Autofill the date input, but don't overwrite user edits. + if (!lastApiData || dateInput.value === lastApiData.system_date) { + dateInput.value = data.system_date; + } + const ntpIconInfo = iconMap.ntpActive[!!data.ntp_active]; if (data.ntp_active) { statusElements.ntpActive.innerHTML = `Active`;