Multiple-Dates-Picker-for-jQuery-UI
Multiple-Dates-Picker-for-jQuery-UI copied to clipboard
With a user dateFormat, the Auto-Select Range does not work
I use dateFormat: "dd.mm.yy", but then the Auto-Select Range does not work.
This does not work (autoselect range with a userdefined dateFormat):
function addDays(date, days) {
var result = new Date(date);
result.setDate(date.getDate() + days);
return result;
}
var today = new Date();
var isoDate = today.toISOString().slice(0,10).replace(/-/g,"");
var y = today.getFullYear();
$('#calendar').multiDatesPicker({
addDates: ['14.10.'+y, '19.02.'+y, '14.10.'+y, '16.11.'+y],
numberOfMonths: [5,3],
defaultDate: addDays(today,-90),
dateFormat: "dd.mm.yy",
beforeShowDay: $.datepicker.noWeekends,
altField: '#altField',
mode: 'daysRange',
autoselectRange: [0,5]
});
This works (single-day selection and userdefined dateFormat):
function addDays(date, days) {
var result = new Date(date);
result.setDate(date.getDate() + days);
return result;
}
var today = new Date();
var isoDate = today.toISOString().slice(0,10).replace(/-/g,"");
var y = today.getFullYear();
$('#calendar').multiDatesPicker({
addDates: ['14.10.'+y, '19.02.'+y, '14.10.'+y, '16.11.'+y],
numberOfMonths: [5,3],
defaultDate: addDays(today,-90),
dateFormat: "dd.mm.yy",
beforeShowDay: $.datepicker.noWeekends,
altField: '#altField'
});
I have the same issue here...
Please Help me. I have same problem !