JSFiddle - React, Tailwind, and code Playground
by Liz4210
HTML
<link rel="stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.17/themes/black-tie/jquery-ui.css">
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.17/jquery-ui.min.js"></script>
<input id="resDate">
JavaScript
$(document).ready(function () {
blackoutDates();
});
function blackoutDates() {
var unavailableDates = ["10/27/2018", "11/8/2018", "4/25/2018"]
$(function () {
$("#resDate").datepicker({
todayHighlight: true,
beforeShowDay: function unavailable(date) {
dmy = date.getDate() + "/" + (date.getMonth() + 1) + "/" + date.getFullYear();
if ($.inArray(dmy, unavailableDates) == -1) {
return [true, "","Available"];
} else {
return [false, "", "Unavailable"];
}
}
});
});
}