mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
The W7 per-user-tz sweep threaded `userTz` through every aggregator on the analytics route except `berlinIsoWeekday()` — the module-level `Intl.DateTimeFormat` stayed pinned to `Europe/Berlin`. A user in `Pacific/Auckland` whose 23:30 weight reading lands at 12:30 the same day in Berlin had their Monday-local reading bucketed under Sunday's weekday column. Pearson/ANOVA on the wrong weekday. Replace the pinned formatter with a per-tz memoised lookup, rename the helper to `isoWeekdayInTz()`, and feed `userTz` through the call site. Also rename the misleading `dateFromBerlinKey()` → `dateFromDayKey()` since the keys it consumes are already anchored to the user's tz upstream. Integration test covers the non-Berlin path: 28 weight readings at a UTC instant where the Berlin and Auckland weekdays disagree; the correlator reaches the gate with every seeded row counted, confirming the helper used the user's tz to bucket.