I have just started using jQuery UI's datepicker and I am looking for a way to enable dates that are only in the data array... I tried everything but it doesn't seem to disable any dates. I checked data array and it display everything in the following format if I use console.log(data)
:
["2017-04-28", "2017-05-19", "2017-04-03", "2017-04-05", "2017-04-07", "2017-04-04", "2017-04-12"]
$.ajax({
url: '/getDoctorsAppointments/'+doctor_id+'/',
type: "GET",
dataType: "json",
success:function(data) {
// enable only dates in the "data" array
}
});
Any ideas how I can achieve that only dates in the array are enabled/can be selected in the datepicker?