|
@Html.EJS().DatePicker("datepicker").RenderDayCell("renderDayCell").Render()
<script>
var specialDateValues = [{
id: 1,
date: new Date("4/4/2020"),
festival_name: "Birthday"
},
{
id: 2,
date: new Date("4/18/2020"),
festival_name: "Vacation"
},
{
id: 3,
date: new Date("4/25/2020"),
festival_name: "New Year"
}
];
function renderDayCell(args) {
for (var i = 0; i < specialDateValues.length; i++) {
if (+specialDateValues[i].date === +args.date) { // Check whether the saved date in the popup
if (specialDateValues[i].date.getDay() === 0 || specialDateValues[i].date.getDay() === 6) { // To check if the provided date is week end
args.isDisabled = true; // Add the disabled class
}
}
}
}
</script> |