I have an inline jquery ui datepicker that has some days disabled, like this
$('.calendar').datepicker({
defaultDate: '',
beforeShowDay: function (date){
return [is_valid(date),''];
}
});
Sometimes the current date can be a disabled date. In this case I would like to automatically make the next enabled date to be the default date..
What would be the easiest way to do this?
For testing, here’s a function that will always make the current date disabled
function is_valid(date) {
var current = new Date();
return date.getDate() - 2 > current.getDate();
}
I also created a fiddle at http://jsfiddle.net/crBab/3/
Found a solution
http://jsfiddle.net/crBab/5/