From 2018376afe1d20c29fd11c29087319e4c1bc9a6b Mon Sep 17 00:00:00 2001 From: ai-bot Date: Fri, 23 Oct 2026 09:57:53 +0000 Subject: [PATCH] Bound the check date picker to today (32.8 point 3) --- static/health-check.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/health-check.js b/static/health-check.js index 49d8a5a..781febb 100644 --- a/static/health-check.js +++ b/static/health-check.js @@ -508,7 +508,12 @@ function updateDuePreview() { function setCheckDate() { const checkedAt = document.querySelector("#checked-at"); - checkedAt.value = formatLocalDate(new Date()); + const today = formatLocalDate(new Date()); + checkedAt.value = today; + // The server refuses a check date in the future, because a check that has not + // happened yet cannot be recorded, so the date picker is bounded to today as + // well (section 32.8 point 3). + checkedAt.max = today; updateDuePreview(); checkedAt.addEventListener("change", updateDuePreview); }