feat: add --until, today/yesterday keywords; harmonize date flags#8
Merged
Conversation
Aligns withings-export with the shared quantcli date-flag contract (https://github.com/quantcli/common/blob/main/CONTRACT.md#3-date-flags): --since VALUE inclusive lower bound --until VALUE inclusive upper bound (new) VALUE: today | yesterday | YYYY-MM-DD | Nd/Nw/Nm/Ny Wired through every subcommand that selects a window of data: activity, sleep, workouts, measurements, intraday. ymd-format API params get the inclusive end day; epoch params get the exclusive moment. The sleep --derive iteration loop now respects --until instead of always running to time.Now(). Side effect: relative durations now snap to local midnight. --since 30d previously meant "30 days ago at this exact moment", which made the same command return slightly different results depending on the time of day. It now means "midnight of the day 30 calendar days ago", which matches how absolute dates already worked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 2 of 3 in cross-repo date-flag harmonization across the quantcli export CLIs. Aligns this CLI with the shared contract at quantcli/common/CONTRACT.md §3.
```
--since VALUE inclusive lower bound
--until VALUE inclusive upper bound (new)
VALUE: today | yesterday | YYYY-MM-DD | Nd/Nw/Nm/Ny
```
Wired through activity, sleep, workouts, measurements, intraday. ymd-format API params (`enddateymd`) get the inclusive end day; epoch params (`enddate`) get the exclusive moment. The `sleep --derive` iteration loop respects `--until` instead of always running to `time.Now()`.
One semantic change worth flagging
`--since 30d` previously meant "30 days ago at this exact moment" (`time.Now().AddDate(0,0,-30)`). It now means "midnight of the day 30 calendar days ago". Same as how `--since 2025-01-01` already worked. Matches user intent better — running the same command at 11:59pm vs 12:01am should not return different windows.
Test plan
Cross-repo status
🤖 Generated with Claude Code