jquery.mtz.monthpicker icon indicating copy to clipboard operation
jquery.mtz.monthpicker copied to clipboard

Set initial month and year from value attribute

Open wasinger opened this issue 11 years ago • 1 comments

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.

wasinger avatar Jun 05 '13 11:06 wasinger

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.

AlexandreArpin avatar Jun 26 '13 20:06 AlexandreArpin