From c45fcd780438686e348df10bc07c546a37b223f5 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 22 Jun 2026 19:39:31 +0000 Subject: [PATCH] fix: event date filters unusable (datetime-local, no apply) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The unit and vibration-location event tabs used datetime-local From/To inputs with onchange. Picking a date but leaving the time blank left the value empty, so nothing applied — and there was no Apply button, so date-only filtering was impossible. Switch From/To to plain date inputs (apply immediately on selection) and send a full inclusive day to the backend (From 00:00:00 → To 23:59:59). Co-Authored-By: Claude Opus 4.8 (1M context) --- templates/unit_detail.html | 9 +++++---- templates/vibration_location_detail.html | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/templates/unit_detail.html b/templates/unit_detail.html index 1402292..b6129ae 100644 --- a/templates/unit_detail.html +++ b/templates/unit_detail.html @@ -473,12 +473,12 @@
-
-
@@ -2882,8 +2882,9 @@ async function loadUnitEvents() { const ft = document.getElementById('ue-filter-ft').value; const limit = document.getElementById('ue-filter-limit').value; params.set('bucket', bucket); - if (from) params.set('from_dt', from.replace('T', ' ')); - if (to) params.set('to_dt', to.replace('T', ' ')); + // Date inputs: From = start of that day, To = inclusive end of that day. + if (from) params.set('from_dt', from + ' 00:00:00'); + if (to) params.set('to_dt', to + ' 23:59:59'); if (ft) params.set('false_trigger', ft); params.set('limit', limit); diff --git a/templates/vibration_location_detail.html b/templates/vibration_location_detail.html index a0fefa2..319a226 100644 --- a/templates/vibration_location_detail.html +++ b/templates/vibration_location_detail.html @@ -287,12 +287,12 @@
-
-
@@ -501,8 +501,9 @@ async function loadLocationEvents() { const to = document.getElementById('ev-filter-to').value; const ft = document.getElementById('ev-filter-ft').value; const limit = document.getElementById('ev-filter-limit').value; - if (from) params.set('from_dt', from.replace('T', ' ')); - if (to) params.set('to_dt', to.replace('T', ' ')); + // Date inputs: From = start of that day, To = inclusive end of that day. + if (from) params.set('from_dt', from + ' 00:00:00'); + if (to) params.set('to_dt', to + ' 23:59:59'); if (ft) params.set('false_trigger', ft); params.set('limit', limit);