6

I have the following code which disables the current date by setting minDate to current date + 1:

    var today = new Date();
    var tomorrow = new Date();
    tomorrow.setDate(today.getDate() + 1);

        $("#minDate").datepicker({
            showOn: "none",
            minDate: tomorrow,
            dateFormat: "DD dd-mm-yy",
            onSelect: function(dateText) {
                minDateChange;
            },
            inputOffsetX: 5,
        });

Datepicker that has the current date disabled

The problem is that I want to disable the current date, but still keep it highlighted (Blue border around the date) in the calendar.

Is there a native way to do this using the datepicker or do I have to create a highlight script myself?

4

2 回答 2

0

datepicker 在今天有一个名为“ui-datepicker-today”的类,所以我只是添加了一个类:

$(".ui-datepicker-today span").addClass("ui-state-hover")
于 2013-04-17T11:58:30.013 回答
0

您不需要将今天和明天设置为变量。刚刚设置minDate: 1

于 2014-03-05T16:34:18.627 回答