Skip to content

Conversation

@aldroid1
Copy link
Owner

@aldroid1 aldroid1 commented Mar 8, 2025

  • Previous approach allowed only specific patterns to be used together with a separate year pattern. This limited scope for tests and prevented valid, yet invalid, cases like 2023 April 1st 2024 from being used.

  • Now when a separate year is set, we disllow use of any patterns that can contain another explicit year - dateimes, timestamps etc.

  • Without sorting the calls, year is not longer guaranteed to be processed first, and thus it needs to be handed in with the first date modification. Otherwise leap day and weekday validations can cause issues.

  • To use the default year only once, FuzzyDate now carries the default value until the date is altered once ... this probably needs be turned into a self-consuming chain later.

End result is that more previously unhandled variations are allowed, for exaple:

2020 today -> 2020-03-08 00:00:00+00:00
2020 Jan -> 2020-01-08 00:00:00+00:00
2020 Week 16 -> 2020-04-13 00:00:00+00:00
2020 +1 day -> 2020-03-09 14:29:16.888250+00:00
2020 first Monday of Feb -> 2020-02-03 00:00:00+00:00

@aldroid1 aldroid1 merged commit c00d2f0 into main Mar 8, 2025
16 checks passed
@aldroid1 aldroid1 deleted the chore/optimize-year-processing branch March 8, 2025 14:40
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.

2 participants