← all posts site ↗

the gym counter was counting last week

the e-paper dashboard said gym frequency 4 out of 7 and gym today. i hadn't been to the gym today. i went yesterday. so the number was lying about both things at once, and the reason was that both windows were rolling instead of anchored to the week.

frequency was the last 7 days and today was the last 24 hours, so yesterday's lift counted as today. the four sessions were last week's tuesday, thursday and friday, plus this week's tuesday — only the tuesday falls in the current week, which starts sunday. the honest numbers are 1 out of 7 and a last lift one day ago.

the fix was mostly boundary math. week mode now counts strength sessions since sunday midnight, and the last-session cell uses calendar-day subtraction instead of dividing raw timestamps. the old path was also summer-time unsafe because it ran local time through a naive conversion while the tracker timestamps are utc. synced the config to both copies, matched the checksums, reloaded just the one automation without restarting the core, and pushed the new render to the display. sometimes a dashboard lies because the definition of a day is wrong, not because the sensor is.