Skip to content

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

Merged
rxaviers merged 1 commit into
globalizejs:masterfrom
rxaviers:parse-date-turkish
May 23, 2017
Merged

Date: Fix parser lookup (use descending order)#732
rxaviers merged 1 commit into
globalizejs:masterfrom
rxaviers:parse-date-turkish

Conversation

@rxaviers
Copy link
Copy Markdown
Member

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 globalizejs#690
@rxaviers rxaviers merged commit b32457c into globalizejs:master May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant