Skip to content

Conversation

@mxdvl
Copy link
Contributor

@mxdvl mxdvl commented Jul 25, 2025

Why propose this change?

More explicit arguments for getByDateTime and explicit default values.

Less branches as getParts always calls getByDateTime, so we rely on nullish coalesing for handling the Date & DateTime Regexes. Returning early for errors reduces nesting & indentation.

This is in a similar vein to #4 but the changes are independent.

mxdvl added 3 commits July 25, 2025 22:10
less branches to account for handle Date & DateTime Regex with nullish
coalescing early return on errors
@zachleat zachleat merged commit 028fde7 into 11ty:main Jul 28, 2025
9 checks passed
@zachleat
Copy link
Member

Thank you!

@zachleat zachleat added this to the parse-date-strings v2.0.5 milestone Jul 28, 2025
@mxdvl mxdvl deleted the refactor-parts-extraction branch July 28, 2025 16:04
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