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

Changed compare_days to use english date format #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

depiction
Copy link

@depiction depiction commented Jun 8, 2016

Currently, if using moment-with-locales.js, startDate set, and lang set to "ar" (arabic), the compare_days function always returns -1. Therefore, all dates in the datepicker are invalid except the current day.

moment(m1).format('YYYYMM') returns a date format in arabic and parseInt is unable to parse it into an integer, so it returns NaN. To resolve this, always get the date for comparison in an English based date format.

…from appearing invalid in arabic with startDate set
@holtkamp
Copy link
Collaborator

holtkamp commented Jun 9, 2016

Thanks, can you provide a "demo" of this approach in index.html, which can act a bit as a test case?

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

Successfully merging this pull request may close these issues.

2 participants