I have written code in jsfiddle.net/udgeet/VUb5r/
I have to disable the previously selected date
I have written code in jsfiddle.net/udgeet/VUb5r/
I have to disable the previously selected date
You can use datePicker's beforeShowDay option to specify which dates you want to enable or disable.
Then it's just a case of writing a functions to
a) get the dates from the select into an array:
function daysToDisable() {
var dates = [];
for (i = 0; i < $('#inputdates option').length; i++) {
dates[i] = new Date($('#inputdates option').eq(i).val()).toString();
}
return dates;
}
and b) return true or false if the current date is in the array
function disableDates(date) {
var days = daysToDisable();
for (i = 0; i < days.length; i++) {
if ($.inArray(date.toString(), days) != -1) {
return [false];
}
}
return [true];
}