Skip to content

Ignore quoted field letters when inferring date and time field order - #1442

Open
shrohan2003 wants to merge 1 commit into
python-babel:masterfrom
shrohan2003:fix/quoted-field-order
Open

shrohan2003 wants to merge 1 commit into
python-babel:masterfrom
shrohan2003:fix/quoted-field-order

Conversation

@shrohan2003

Copy link
Copy Markdown

parse_date("day 04/03/2026", format="'day' MM/dd/yyyy") treats the letters in “day” as date fields and raises an error. Similarly, parsing a time with a quoted label can silently swap the hour and seconds.

Determine field order using the existing pattern tokenizer so quoted text cannot introduce fields. The tests round-trip a date and a time through their respective formatting and parsing APIs.

This branch has not been deployed

No deployments
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.

1 participant