mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
The eleven per-metric/derived-score status helpers (pulse, weight, bmi, mood, blood-pressure, medication-compliance, general, the generic metric card, biomarker, the shared feature cache, the derived-score AI warm layer) computed todayKey from toBerlinDayKey(new Date()) before resolving the user's own timezone — several fetched the profile only for downstream day-bucketing, after the cache read had already run on the Berlin key. A non-Berlin user's card regenerated at their local evening (Berlin midnight) and, for biomarker series and the derived-score prompt label, mis-keyed data or displayed a hardcoded "(Europe/Berlin)" regardless of their actual zone. Threads resolveUserTimezone()/userDayKey() ahead of every cache read so the day-key and the data bucketing agree, and reuses the one resolved value everywhere downstream instead of re-deriving it.