From 733275b155eccfe593c73b89fe6d1b9c9b310f28 Mon Sep 17 00:00:00 2001 From: Tanner Date: Wed, 26 Aug 2026 16:11:32 +0000 Subject: [PATCH] feat: only display even hours for day duration 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 426a5bd..52e7ef8 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -79,7 +79,9 @@ function useSensor(measurement, name, end, duration) { data.forEach(d => { const lbl = memoConvertTZ(isDST, d.time, duration.format); if (lbl !== lastLabel) { - if (duration.len !== 'Month' || dayCount % 2 === 0) { + const isMonthSkip = duration.len === 'Month' && dayCount % 2 !== 0; + const isDaySkip = duration.len === 'Day' && parseInt(lbl, 10) % 2 !== 0; + if (!isMonthSkip && !isDaySkip) { ticks.push(d.time); } lastLabel = lbl; @@ -728,7 +730,9 @@ function MultiLineChart({title, measurement, dataKey, sensors, colors, end, dura data.forEach(d => { const lbl = memoConvertTZ(isDST, d.time, duration.format); if (lbl !== lastLabel) { - if (duration.len !== 'Month' || dayCount % 2 === 0) { + const isMonthSkip = duration.len === 'Month' && dayCount % 2 !== 0; + const isDaySkip = duration.len === 'Day' && parseInt(lbl, 10) % 2 !== 0; + if (!isMonthSkip && !isDaySkip) { ticks.push(d.time); } lastLabel = lbl;