Skip to content

Changed compare_days to use english date format#248

Open
depiction wants to merge 1 commit intolongbill:masterfrom
depiction:pr/147
Open

Changed compare_days to use english date format#248
depiction wants to merge 1 commit intolongbill:masterfrom
depiction:pr/147

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