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

Navigation between months using previous/next arrows #89

Open
hbaccara opened this issue Sep 7, 2015 · 0 comments
Open

Navigation between months using previous/next arrows #89

hbaccara opened this issue Sep 7, 2015 · 0 comments

Comments

@hbaccara
Copy link

hbaccara commented Sep 7, 2015

If the the number of days in the current month is higher than the number of days in the previous/next month, the datepicker jumps two months back/ahead when the user selects the last day of the month then clicks prev/next .
For instance, if the user navigates to August, selects the day 31 then clicks the NEXT arrow, the date picker displays October instead of September.
The issue can be fixed by replacing the following in the code:
// Adjust date for month offset
_date.setMonth(_date.getMonth() + _offset);
_date.setDate(Math.min(1, _date._max()));
by the following:
// Adjust date for month offset
_date.setMonth(_date.getMonth() + _offset, 1);

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

No branches or pull requests

1 participant