From 9672591113a12f3c8d3a773f13782d4bef0ad3b1 Mon Sep 17 00:00:00 2001 From: Toan Le Ba Date: Wed, 29 Apr 2026 23:35:15 +0700 Subject: [PATCH] fix: resolve undefined 'cutoff' variable in hourly filtering The hourly aggregation filter in applyFilter() referenced an undefined variable 'cutoff', causing a ReferenceError when filtering hourly data by date range. Fixed by using the proper 'start' and 'end' variables that are already defined in the function scope. Closes #1 --- dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard.py b/dashboard.py index ebf8d5f..a6621a4 100644 --- a/dashboard.py +++ b/dashboard.py @@ -742,7 +742,7 @@ def get_dashboard_data(db_path=DB_PATH): // Hourly aggregation (filtered by model + range, then bucketed by UTC hour) const hourlySrc = (rawData.hourly_by_model || []).filter(r => - selectedModels.has(r.model) && (!cutoff || r.day >= cutoff) + selectedModels.has(r.model) && (!start || r.day >= start) && (!end || r.day <= end) ); const hourlyAgg = aggregateHourly(hourlySrc, hourlyTZ);