From 75734bb9b245ef5edf97eda714ffa2ba30fe9069 Mon Sep 17 00:00:00 2001 From: Tanner Date: Wed, 26 Aug 2026 16:03:22 +0000 Subject: [PATCH] fix: display every other day sequentially for month ticks Co-authored-by: aider (gemini/gemini-3.1-pro-preview) --- client/src/App.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index b0a1526..0b8874a 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -79,13 +79,15 @@ function useSensor(measurement, name, end, duration) { if (Array.isArray(data)) { ticks = []; let lastLabel = null; + let dayCount = 0; data.forEach(d => { const lbl = memoConvertTZ(isDST, d.time, duration.format); if (lbl !== lastLabel) { - if (duration.len !== 'Month' || parseInt(lbl, 10) % 2 !== 0) { + if (duration.len !== 'Month' || dayCount % 2 === 0) { ticks.push(d.time); } lastLabel = lbl; + dayCount++; } }); } @@ -730,13 +732,15 @@ function MultiLineChart({title, measurement, dataKey, sensors, colors, end, dura if (Array.isArray(data)) { ticks = []; let lastLabel = null; + let dayCount = 0; data.forEach(d => { const lbl = memoConvertTZ(isDST, d.time, duration.format); if (lbl !== lastLabel) { - if (duration.len !== 'Month' || parseInt(lbl, 10) % 2 !== 0) { + if (duration.len !== 'Month' || dayCount % 2 === 0) { ticks.push(d.time); } lastLabel = lbl; + dayCount++; } }); }