Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Cannot pick a date in august if language is italian #61

Open
tiljanssen opened this issue Sep 13, 2016 · 2 comments
Open

Cannot pick a date in august if language is italian #61

tiljanssen opened this issue Sep 13, 2016 · 2 comments

Comments

@tiljanssen
Copy link
Contributor

The current check for "ago" and "ahead" in the date input will match "Agosto" which is the italian translation for August.
Since the month is not the 3rd word in the date, this means that dates picked in august will revert back to the current date.

I suggest you use regexp with word boundaries instead of simply searching the date string.

Note also that you try to use a "lookbehind" regexp to strip the "st|nd|rd|th" from the day. However lookbehind is not supported in javascript, and this results in any match of "st" including the "st" in Agosto.
A better regexp may be /(?:\d)((?:st|nd|rd|th)?,?/ (it also gets rid of a possible comma after the day when someone enters august 2nd, 2016) For even more accuracy you might also add a word boundary somewhere.

@basvis
Copy link

basvis commented Sep 21, 2016

@tyvdh +1

@tiljanssen
Copy link
Contributor Author

Fixed in pull request #62, can be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants