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

Date: Fix parser lookup (use descending order) #732

Merged
merged 1 commit into from May 23, 2017

Conversation

@rxaviers
Copy link
Member

rxaviers commented May 23, 2017

parseDate fails on Turkish full datetime with Monday or Saturday.

The root cause is that the parser lookup finds Cuma (Fri) before it
finds Cumartesi (Sat), similarly it finds Pazar (Sun) before it finds
Pazartesi (Mon), and therefore the token doesn't entirely consume the
input.

The fix approach is to start the lookup with longer names, then the
shorter ones.

Fixes #690

parseDate fails on Turkish full datetime with Monday or Saturday.

The root cause is that the parser lookup finds Cuma (Fri) before it
finds Cumartesi (Sat), similarly it finds Pazar (Sun) before it finds
Pazartesi (Mon), and therefore the token doesn't entirely consume the
input.

The fix approach is to start the lookup with longer names, then the
shorter ones.

Fixes #690
@rxaviers rxaviers merged commit b32457c into globalizejs:master May 23, 2017
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

1 participant
You can’t perform that action at this time.