parseDate fails on Turkish full datetime with Monday or Saturday #690
Labels
Milestone
Comments
Interesting... Thanks! |
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. |
rxaviers
added a commit
to rxaviers/globalize
that referenced
this issue
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 globalizejs#690
rxaviers
added a commit
to rxaviers/globalize
that referenced
this issue
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 globalizejs#690
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @rxaviers,
parseDate
appears to have a bug in parsing Turkish full datetime strings when it's a Monday ('"Pazartesi") or Saturday ("Cumartesi").My environment:
Here's a Node script demonstrating the problem:
Output:
Just a hunch: Turkish "Monday" and "Saturday" are the only days of the week with dotted i. I know the Turkish
i
casing issues can be tricky, so that may be a potential lead.The text was updated successfully, but these errors were encountered: