Skip to content

Navigation between months using previous/next arrows #89

Description

@hbaccara

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions