Skip to content

Commit dfe32bc

Browse files
docs(prime): add RecordedTime date example and warn that Day is null for servings (#26)
The gocronometer ServingRecord struct exposes a Day field in JSON output that is always null. Add a GOTCHA note directing users to RecordedTime for date-based jq filtering, and add a concrete date-filter recipe using RecordedTime | startswith(...) to match the biometrics sort_by pattern. Fixes #25 Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Darrell <DTTerastar@users.noreply.github.com>
1 parent 3792cdc commit dfe32bc

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cmd/prime.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ EXAMPLES
9191
# All foods from today's breakfast
9292
crono-export servings --since today --format json | jq '[.[] | select(.Group == "Breakfast") | .FoodName]'
9393
94+
# All servings on a specific day
95+
crono-export servings --since 7d --format json | jq '[.[] | select(.RecordedTime | startswith("2026-04-25"))]'
96+
9497
# Latest weight reading in a 30-day window
9598
crono-export biometrics --since 30d --format json | jq 'map(select(.Metric == "Weight")) | sort_by(.RecordedTime) | last'
9699
@@ -103,6 +106,8 @@ GOTCHAS
103106
every column (including zeros), use --format json.
104107
- Cronometer logs by calendar day; nothing here is real-time. Two
105108
'--since today' calls moments apart return the same data.
109+
- 'servings' JSON rows contain a 'Day' field that is always null — use
110+
'RecordedTime' (an ISO-8601 timestamp) for any date-based filtering.
106111
`
107112

108113
var primeCmd = &cobra.Command{

0 commit comments

Comments
 (0)