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

fix roundtrip bug with d/EEEE ordering in formats like PPPPP #1795

Merged
merged 15 commits into from Jul 17, 2020

Conversation

arsnyder16
Copy link
Contributor

@arsnyder16 arsnyder16 commented May 20, 2020

Anytime two tokens exist in a format string that have the same priority one needs to take precedent over the other when parsing otherwise incorrect values will be parsed.

The example that is shown in the snapshots that are now fixed are cases where E and d coexist such as PPPP. Before some locales would handle it find because E would come before d, but in locales where d came before E there were issues. So adding a sub priority so we can correctly sort which token takes precedent.

en-US : PPPP 'EEEE, MMMM do, y
ja : PPPP y年M月d日EEEE

@kossnocorp
Copy link
Member

I'll appreciate it if you can provide an explanation for your changes. Thanks!

@arsnyder16
Copy link
Contributor Author

@kossnocorp Updated the first comment to include a description

Copy link
Member

@kossnocorp kossnocorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, appreciate it!

@kossnocorp kossnocorp merged commit 2a73ae1 into date-fns:master Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants