Commit d68148b
fix: pass time.Local (not time.UTC) to gocronometer parsers
Three call sites in cronoclient.Client hardcoded time.UTC when invoking
ExportServingsParsedWithLocation, ExportExercisesParsedWithLocation, and
ExportBiometricRecordsParsedWithLocation. The result was that every
RecordedTime emitted by these subcommands carried a UTC offset (`...Z`)
regardless of the host zone, in direct violation of the timezone
contract: https://github.com/quantcli/common/blob/main/CONTRACT.md#2-timezone-policy
Beyond the JSON cosmetic, this caused the markdown date-bucketing in
cmd/format.go (`r.RecordedTime.Format("2006-01-02")`) to compute the
wrong calendar day for any host west of UTC: a record logged at 9pm
local on day N bucketed one day late.
Fix: time.UTC → time.Local in all three calls.
Verified:
$ crono-export servings --since 7d --format json | jq '.[0].RecordedTime'
"2026-05-02T00:00:00-04:00" # was "2026-05-02T00:00:00Z"
Closes #13.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Orca <help@stably.ai>1 parent dfe32bc commit d68148b
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
0 commit comments