Repository navigation
Conversation
Assisted-by: OpenAI Codex
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1394 +/- ##
==========================================
+ Coverage 97.21% 97.27% +0.06%
==========================================
Files 236 236
Lines 3084 3087 +3
==========================================
+ Hits 2998 3003 +5
+ Misses 86 84 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Custom formats fill missing month/day fields from the system clock even when
RELATIVE_BASEis supplied. For example, parsing"2022"withdate_formats=["%Y"]andRELATIVE_BASE=datetime(2020, 4, 30)uses today's month and day instead of returning2022-04-30.Pass the month/day from an explicit
RELATIVE_BASEto the existing helpers when filling those fields. Explicit first/last preferences still take precedence, and complete dates and reported periods are preserved. When no relative base is supplied, the helpers retain their existing local-clock defaults.The regressions freeze the system clock independently of
RELATIVE_BASEand cover missing month, missing day, both missing fields, February day clamping with explicit leap/non-leap years, and first/last preferences. Four cases fail before the fix. Another control keeps the existing local-clock default when UTC and local time fall in different months.Year inference remains unchanged. This is independent of the yearless month-end issue handled in #1389.
Validation on Python 3.12.3 with calendar/langdetect extras and timezone data installed:
pytest tests --ignore=tests/benchmarks --cov=dateparser: 24,369 passed, 15 skipped, 1 expected failure; 97% coverage.pre-commit run --all-files: passed (Ruff 0.9.3 lint and formatting).twine check: passed.This issue was identified during source review. The implementation and tests were prepared with OpenAI Codex assistance.