Soldato
my datepicker was working fine until about a month ago i noticed it not acting right. it still works, but the date restriction range doesn't work any more, and when clicking the input field, i get the standard browser "recent typed options" popping up over the datepicker.
can someone take a look at this code and see anything wrong with it?
can someone take a look at this code and see anything wrong with it?
Code:
<div id="datepicker"></div>
<link href="/j/jquery-ui.min.css" rel="stylesheet">
<script src="/j/jquery-ui.min.js"></script>
<script>
var notAvailableDates = "";
</script>
<?php if ($service == "oven") { ?>
<script>
var notAvailableDates = ["18-6-2018","21-6-2018"];
</script>
<?php } ?>
<script>
function available(date) {
dmy = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear();
if ($.inArray(dmy, notAvailableDates) !== -1) {
return [false, "","unAvailable"];
} else {
return [true,"","Available"];
}
}
$( "#date" ).datepicker({
beforeShowDay: available,
minDate: -0,
maxDate: "+10M +10D",
dateFormat: 'dd/mm/yy',
firstDay: 1,
beforeShowDay: $.datepicker.noWeekends,
});
</script>