Victor Guedes
Victor Guedes

Reputation: 55

how keep the calendar in the current selection month in multidatespicker

There is a problem (when used the approach "From input") in multidatespickr that makes the calendar back to the current month when you select two dates in some other month.

Example:

$(document).ready(function() {
    $('#from-input').multiDatesPicker();
});

Official demo with problem too.

I'm use MultiDatesPicker v1.6.3

Upvotes: 0

Views: 1194

Answers (1)

leon
leon

Reputation: 31

simply add: onSelect: function(dateText, inst) { inst.settings.defaultDate = dateText; }

        $(function() {
      $( ".datepicker").multiDatesPicker({
        minDate: 0, showButtonPanel: true, changeMonth: true, changeYear: true          
            , onSelect: function(dateText, inst) { inst.settings.defaultDate = dateText; }

      });
    });

I found it here

Upvotes: 1

Related Questions