mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
Switching a chart from 7 to 30 days moved steps, active energy, flights and distance totals onto neighbouring days. The 7-day range buckets raw rows by the user's calendar day; the 30-day range read the DAY rollup tier, whose buckets are UTC days, and the chart labelled each bucket's UTC-midnight start in the user's zone. East of UTC a sample shortly after local midnight counted on the previous day; west of UTC every bucket read one day early. The daily series (the chart read and the batched dashboard read) and the aggregate=daily|weekly|monthly list now fold live in the user's zone and return the instant of local midnight, so every range and every summed metric shares one day boundary. The fold runs in Postgres and returns one row per day; about 0.1 s for 90 days of per-minute samples. Windows longer than the DAY cap still step up to the coarser rollup tiers. Refs #1026