JQuery UI Datepicker - disable current date but not highlight

I have the following code that disables the current date by setting minDate to the 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 turn off the current date, but still keep it selected (blue frame around the date) in the calendar.

Is there any own way to do this using datepicker or do I need to create a selection script myself?

+5
source share
2 answers

Datepicker has a class on today's date called "ui-datepicker-today", so I just added a class to this:

$(".ui-datepicker-today span").addClass("ui-state-hover")
0
source

you do not need to set today and tomorrow as a variable. just installminDate: 1

0
source

All Articles