call multiDatesPicker for multi times with defaultValue
If addDates and default were set together, and I call 'multiDatesPicker' for the second time, 2016-08-14 will be selected any way. Even if I called 'resetDates'. following is the sample code, run the script and you'll understand.
`
var date = new Date('2016-08-18');
var date1 = date.setDate(19);
var date2 = date.setDate(14);
$('#simpliest-usage').multiDatesPicker({
addDates: [date1, date2],
defaultDate: date
});
setTimeout(function () {
$('#simpliest-usage').multiDatesPicker('resetDates');
date = new Date();
date1 = date.setDate(15);
date2 = date.setDate(16);
$('#simpliest-usage').multiDatesPicker({
addDates: [date1, date2],
defaultDate:date
});
$('#simpliest-usage').multiDatesPicker('removeDates', new Date('2016-08-14'));
}, 5000);
`
I'm currently calling removeDates to solve the issue temporarily lol. Glad that in my project, dates won't repeat.
My problem is when i am loading MDP second time based on drop down, it is automatically selecting today date.
jQuery('#calender').multiDatesPicker();--------Showing calender jQuery('#calender').multiDatesPicker('resetDates');-----------------Not showing calender
take a look of my issue https://github.com/dubrox/Multiple-Dates-Picker-for-jQuery-UI/issues/190 what to do?