Jquery Calendar Disabled Date colour

2019-08-02 11:54发布

How can I change the background color of the disabled dates in May to red?

<input id="iDate">

<script type='text/javascript'>
var unavailableDates = ["9-5-2013", "14-5-2013", "15-5-2013"];

function unavailable(date) {
dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
if ($.inArray(dmy, unavailableDates) == -1) {
    return [true, ""];
} else {
    return [false, "", "Unavailable"];
}
}

$(function() {
$("#iDate").datepicker({
    dateFormat: 'dd MM yy',
    beforeShowDay: unavailable
});

});
</script>

http://jsfiddle.net/JjPrU/178/

1条回答
看我几分像从前
2楼-- · 2019-08-02 12:27
.ui-datepicker td.ui-state-disabled>span{background:#c30;}
.ui-datepicker td.ui-state-disabled{opacity:100;}

http://jsfiddle.net/habo/JjPrU/179/

查看更多
登录 后发表回答