Skip to content

feat(list): accept "yesterday" as a date argument - #35

Open
rn404 wants to merge 1 commit into
mainfrom
feat/list-yesterday
Open

feat(list): accept "yesterday" as a date argument#35
rn404 wants to merge 1 commit into
mainfrom
feat/list-yesterday

Conversation

@rn404

@rn404 rn404 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • `sava list yesterday` (and `today`, case-insensitive) now works alongside the existing `sava list `
  • New `model.ResolveRelativeDate` translates the keyword to a real date before it reaches `logfile.Stat`; anything else (including an already well-formed date, or empty) passes through unchanged, so existing behavior is untouched
  • Scoped to `list` only, per request — `diff`/`del`'s `:` refs are unaffected

Test plan

  • `go build ./...`, `go vet ./...`, `gofmt -l .`, `golangci-lint run ./...`
  • `go test ./...` (new: `TestResolveRelativeDate`, `TestListYesterday`, `TestListYesterdayKeyword`)
  • Manual smoke test of the built binary: `list yesterday`, `list Yesterday`, `list yesterday -s`, and confirmed `list not-a-date` still errors

sava list yesterday resolves to an actual yyyy-MM-dd via
model.ResolveRelativeDate before hitting logfile.Stat, so the
existing storage/view code is untouched. "today" is supported too for
symmetry (list already defaults to today on no argument). Both are
case-insensitive; anything else passes through unchanged to the
existing strict date parser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant