tamble / jquery-ui-daterangepicker

A JQuery UI based date range picker.
MIT License
184 stars 110 forks source link

After selecting period from different month - calling "setRange" incorrectly brings calendar to initial month #85

Open peshoicov opened 6 years ago

peshoicov commented 6 years ago

The plugin is awesome and we're using it.

However - when a users navigates - let say 5 months ahead - and then selects range - the calendar goes back to the initial month.

I debugged the plugin's source code and saw that when we use "setRange" - it automatically calls:

(...).datepicker('refresh'); (...).datepicker('setDate', null);

The latter is what brings the calendar back to it's initial month. But we do not want this - our user has navigated months ahead.

Why is this behavior in the first place? ... and can we avoid it?

PS: We do not automatically close the calendar, as in the official examples.