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

Set initial month and year from value attribute #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wasinger
Copy link

@wasinger wasinger commented Jun 5, 2013

If the month/year input already has a value attribute when the form is loaded and the value is parseable to a valid month and year using settings.pattern, then settings.selectedYear and settings.selectedMonth are set from this value.

@AlexandreArpin
Copy link

You should specify your base in the second parameter of parseInt instead of replacing the leading 0, the reason you had weird behavior is because JS thought your value was in octal and not decimal.

Correct way to do it would be
month = parseInt(month, 10);

Otherwise it seems not very flexible or useful I think.

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