My may be a bit easy, but being new on this topic is a bit complicated.
I have this code
<pre>
<em>
$(document).ready(function() {
var date = $.getJSON("prueba.php?providerid=157&startdate='2018-04-05'", function(result){
for (var item in result) {
return(result[item]);
}
});
console.log(date);
$("#select_days").kendoCalendar({
value: Date(),
dates: [
new Date("2018-5-12"),
],
disableDates: function (date) {
var dates = $("#select_days").data("kendoCalendar").options.dates;
if (date && compareDates(date, dates)) {
return false;
} else {
return true;
}
}
});
function compareDates(date, dates) {
for (var i = 0; i < dates.length; i++) {
if (dates[i].getDate() == date.getDate() &&
dates[i].getMonth() == date.getMonth() &&
dates[i].getYear() == date.getYear()) {
return true
}
}
}
});
</em>
</pre>
The idea is that the array dates
upload the data that is in the varible date
.