Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP/RFC: extend date formats with markers for optional and fixed length markers #28741

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bug-brain
Copy link

This pull requests changes the behavior of parsing dates that currently doesn't error when reaching the end of a string. It introduces [...] to mark optional parts that do not have to come at the end. The format y m d would become [y[ [m[ [d]]]]]. It's much longer but my guess is that mandatory parts are wanted more often.

Previously parts only had fixed length when they were not separated from the next part. This detection is replaced by ! to mark fixed length.

Formats like yyyy![mm!]dd! do not work because there is no rollback after an optional part has been successfully.

These changes would help with #28090 and #26962.

@KristofferC KristofferC added kind:breaking This change will break code domain:dates Dates, times, and the Dates stdlib module labels Aug 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:dates Dates, times, and the Dates stdlib module kind:breaking This change will break code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants