Multiple-Dates-Picker-for-jQuery-UI icon indicating copy to clipboard operation
Multiple-Dates-Picker-for-jQuery-UI copied to clipboard

Always return to current date

Open CaptnKebec opened this issue 10 years ago • 4 comments

Hi, Is there a way to keep the month where we do the selection instead of returning to the current date after each date selection. This is very confusing for my users. Ex. the current date is June 6, and if I pick dates in the month of June, I see my selections, but if I move to July and pick a date, multipleDatesPicker return me to June, so I have to go to July again to continue my selection.

Thanks

CaptnKebec avatar Jun 17 '15 18:06 CaptnKebec

Not sure if this is what CaptnKebec is referring to, but I notice this same behavior when the date picker is used with an input box. You can see it in the "From input" demo.

When you navigate to the next month, and select more than one date, you are kicked back to the current month.

by225 avatar Jul 16 '15 16:07 by225

I resolved the issue by first assign a function to the change event( I was using one anyway) $('#req_dtDebut').multiDatesPicker({ mode: 'normal', minDate: 0, maxDate: 365, onSelect: function (dateText, inst) { HideHourIfMoreDates(dateText); } });

In the function, I put the selected date as the default date for the picker, like this: $('#req_dtDebut').datepicker("option", "defaultDate", dateText);

It makes the calendar flicker but it stays in the month selected. If someone find a better way avoiding the flicker, it would be perfect!

CaptnKebec avatar Jul 16 '15 16:07 CaptnKebec

I closed the issue by mistake, reopening it!

CaptnKebec avatar Jul 16 '15 16:07 CaptnKebec

@CaptnKebec can you show me your code in the function. thanks

sergeaubin avatar Jul 12 '16 15:07 sergeaubin