Is there a way to prevent a date range selection from crossing invalid days?
I have the 19th set as invalid but when i select the range across if from the 15th to the 20th it allows that range. Is there a way to stop the selection range at the 18th?
Currently this is not supported out of the box. The invalid dates are not allowed for start or end dates only. What you could do is to implement a custom logic in the onDayChange event, which gets called when a date is tapped on the calendar. Returning false from this event prevents date selection. Here’s the basic idea using jquery:
$('#myrange').mobiscroll().range({
onDayChange: function (day, inst) {
if (day.active == 'end') { // End date was selected
var dates = inst.getVal(true);
// Check with custom logic if the range dates[0] -> day.date is valid
// If not, return false, to prevent end date selection
}
}
});