You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Malformed YYYY-MM-DD produces confusing 'invalid date unit' error #42
QA finding: when --since or --until looks like a date but doesn't parse (e.g. 2026-99-99, 2026-02-30, 2026-13-45), time.ParseInLocation fails silently and the value falls through to the relative-date parser (Nd/Nw/Nm/Ny). That parser then Sscanfs the leading digits, sees a non-{d,w,m,y} trailing char, and reports:
$ crono-export nutrition --since 2026-99-99
error: bad --since: invalid date unit "9": use d, w, m, or y
$ crono-export nutrition --since 2026-02-30
error: bad --since: invalid date unit "0": use d, w, m, or y
User typed a date, error talks about Nd/Nw/Nm/Ny "units" — confusing, especially 2026-02-30 (a valid-looking Feb 30 from a leap-year confusion).
Suggested fix in parseDateValue: if the value contains a - after position 0 (i.e., looks date-shaped), surface the time.ParseInLocation error rather than falling through. Something like:
Activity
Terastar-Paperclip commentedon May 19, 2026
Triage:
kind:bug·area:dates·priority:lowtime.ParseInLocationerror) is in the body.No CONTRACT.md change — date-flag syntax is unchanged. Engineering ownership.