feat(cli): add natural language date parsing via dateparser

- Add _parse_natural() to utils.py using dateparser as a fallback when
  structured date formats (YYYY-MM-DD, MM-DD, DD-MM) don't match
- Supports expressions like 'today', 'yesterday', 'monday', '3 days ago'
- Change day argument to nargs='*' and join tokens so unquoted
  multi-word expressions like: uv run timesheets 3 days ago work correctly
- Pin dateparser to English to avoid locale-dependent behaviour
- Update tests to cover natural language cases and fix test_last_monday
  (dateparser does not support 'last monday'; use 'monday' instead)
This commit is contained in:
Jef Roosens 2026-05-22 10:57:16 +02:00
parent 29698b1241
commit 615bfe30e0
Signed by: Jef Roosens
GPG key ID: 119385BCAA005C21
6 changed files with 207 additions and 13 deletions

View file

@ -8,6 +8,7 @@ authors = [
]
requires-python = ">=3.13"
dependencies = [
"dateparser>=1.4.0",
"joppy>=1.0.2",
]