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

Datepicker reefresh

Open rajanmidd opened this issue 9 years ago • 3 comments

When you use the text box for multi datepicker and select multi dates , then datepicker refreshed.

Today is 29-12-2015 and when i select the multi dates from datepicker lets take and example i go to July moth 2016 and select 24, 25, 26 when you select 26 , then month automatically goes to December i.e current month. when i select the month of July then it keeps on July not to current month. Please use the example of (From input) on http://multidatespickr.sourceforge.net/.

rajanmidd avatar Dec 29 '15 06:12 rajanmidd

I can confirm the problem and developed a workaround.

When you initialize the datepicker, you have to supply a custom onSelect function, which sets the default date to the last date you selected. When the datepicker is refreshing it automatically jumps to the last date/month selected.

Example workaround code:

$('#datepicker').multiDatesPicker(jQuery.extend(
            {
                onSelect: function(dateText, inst) { // Workaround function
                    inst.settings.defaultDate = dateText; // Set the default date to the last date selected
                }
            }
        ));

rlandgrebe avatar Jan 20 '16 13:01 rlandgrebe

+1 with the same error

str avatar Apr 03 '17 19:04 str

The way I solved it was using the altField flag

            $('#div-to-render-the-calendar').multiDatesPicker({
                altField:   '#from-input'
            });

str avatar Apr 03 '17 20:04 str