2012年的日期并没有被禁用,我无法弄清楚为什么,我已经尝试了所有日期格式,没有任何喜悦 - 任何想法?
<script type="text/javascript">
var unavailableDates = ["27-12-2011", "28-12-2011", "29-12-2011", "03-01-2012", "09-01-2012", "26-01-2012", "14-02-2012"];
function unavailable(date) {
dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
if ($.inArray(dmy, unavailableDates) == -1) {
return [true, ""];
} else {
return [false, "", "Unavailable"];
}
}
</script>
<script type="text/javascript">
$(function () {
$("#datepicker").datepicker({
beforeShowDay: unavailable,
minDate: 0
});
});
</script>