Commit 1bc46c9
fix: resolve --today against local calendar date
--today, --days N, and the default 7-day window previously used
time.Now().UTC(), so in timezones west of UTC, "today" flipped to the
next day shortly after local evening. At 20:xx ET (~00:xx UTC next
day), `crono-export nutrition --today` queried tomorrow's UTC date and
returned an empty result even though the user had logged food "today".
Resolve the reference day from the user's local zone instead, and
construct midnight with time.Date rather than Truncate(24*time.Hour)
(which only aligns to midnight in UTC). Explicit --start/--end string
parsing is unchanged; the fix only affects the three relative modes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7eb37c7 commit 1bc46c9
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | | - | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
38 | | - | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
42 | | - | |
| 46 | + | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
0 commit comments