Marc-André Bombeck
44ab74e125
fix(nutrients): count each day once and anchor the overview window on user tz
...
GET /api/nutrients had two correctness bugs:
- `daysWithData` incremented on every row whose day differed from the
PINNED latest-day field, so a second source's row on an already-seen
older day (water logged via both Apple Health and a manual entry on
the same day) opened a phantom second "day". Track a per-nutrient
set of distinct day keys instead.
- The window floor used a UTC day key against a local-timezone `day`
column, off by up to a day at the edge for non-UTC users. Anchor on
the caller's own local "today" instead, mirroring the sibling
`GET /api/nutrients/daily` route.
2026-07-18 05:06:24 +02:00
..
2026-07-16 19:13:01 +02:00
2026-07-18 02:09:33 +02:00
2026-07-11 10:36:02 +02:00
2026-06-28 16:03:05 +02:00
2026-07-11 00:18:23 +02:00
2026-07-17 20:30:41 +05:30
2026-06-28 13:58:43 +02:00
2026-06-19 22:20:31 +02:00
2026-07-17 09:37:39 +02:00
2026-07-18 02:09:33 +02:00
2026-06-30 08:54:39 +02:00
2026-06-19 22:20:31 +02:00
2026-07-17 14:29:07 +02:00
2026-07-18 03:52:32 +02:00
2026-06-14 23:58:27 +02:00
2026-07-17 17:46:28 +02:00
2026-06-28 17:36:14 +02:00
2026-07-18 02:09:33 +02:00
2026-06-28 16:03:05 +02:00
2026-06-11 02:19:27 +02:00
2026-06-19 22:20:31 +02:00
2026-07-17 23:12:12 +02:00
2026-07-11 01:54:12 +02:00
2026-07-11 01:54:12 +02:00
2026-06-21 14:23:24 +02:00
2026-07-15 22:07:25 +02:00
2026-06-19 22:20:31 +02:00
2026-07-18 05:06:24 +02:00
2026-07-11 01:54:12 +02:00
2026-06-19 22:20:31 +02:00
2026-07-18 02:09:33 +02:00
2026-06-28 15:18:12 +02:00
2026-06-11 02:19:27 +02:00
2026-06-19 22:20:31 +02:00
2026-07-18 02:09:33 +02:00
2026-07-18 00:37:24 +02:00
2026-07-05 20:33:29 +02:00
2026-06-19 22:20:31 +02:00
2026-06-19 22:20:31 +02:00
2026-06-19 22:20:31 +02:00
2026-07-18 00:37:24 +02:00
2026-06-19 22:20:31 +02:00
2026-06-11 02:19:27 +02:00
2026-07-18 05:06:24 +02:00
2026-06-19 22:20:31 +02:00
2026-07-17 23:12:12 +02:00
2026-06-19 22:20:31 +02:00
2026-07-17 23:12:12 +02:00
2026-06-28 15:18:20 +02:00
2026-06-27 21:50:30 +02:00
2026-07-10 02:08:03 +02:00
2026-07-10 21:23:00 +02:00
2026-07-17 23:12:12 +02:00
2026-06-27 19:33:10 +02:00
2026-07-11 08:43:41 +02:00
2026-06-10 11:36:51 +02:00
2026-07-09 23:29:06 +02:00
2026-06-30 18:08:57 +02:00
2026-07-17 23:12:12 +02:00
2026-07-18 02:09:33 +02:00
2026-07-18 05:06:24 +02:00