-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
wrong month shown when setting minDate to a later year #93
Comments
Thanks for this solution @eduter |
Nice. I just wish stuff like this was incorporated into the library instead of laying on the side like this. |
I'm assuming this happens when you initialize Pikaday with a default selected date before the |
The wrong month is sometimes shown when minDate year > default date's From the issue's description: When you set minDate for a date after the currently selected date, the calendar, when shown, should display the month where minDate is. This works if both dates are in the same year, but if the new minDate's year is greater than the selected one, the month shown will be a mix of the selected date's month with the minDate's year. There is a separate issue in that `setMinDate` and `setMaxDate` do not update the min/maxMonth and min/maxYear internal options.
* bjbrewster/master: Fix Date.parse bug when using Datejs Fix issue Pikaday#93 wrong month sometimes shown Update README description of defaultDate option Update README Add Ember and Knockout examples Add inputFormats option and parseDate method Add onClear callback and clearInvalidInput option Conflicts: README.md pikaday.js
When you set minDate for a date after the currently selected date, the calendar, when shown, should display the month where minDate is. This works if both dates are in the same year, but if the new minDate's year is greater than the selected one, the month shown will be a mix of the selected date's month with the minDate's year.
Example:
selected date: 2013-08-21
minDate: 2014-01-21
month shown: 2014-08
Apparently, modifying 2 if statements from the draw method to be like this solved the problem:
The text was updated successfully, but these errors were encountered: