user3635095
user3635095

Reputation: 9

disable specific dates in single month of every year jquery datepicker in jquery

i want to disable a specific date from a specific month of every year in datepicker from Jquery Ui. for example: disable auguest(month) 15(date) of every year in datetime picker

Upvotes: 0

Views: 1416

Answers (1)

Barmar
Barmar

Reputation: 780724

Use the beforeShowDay option.

$("selector").datepicker({
    ...
    beforeShowDay: function(date) {
        var month = date.getMonth()+1; // +1 because JS months start at 0
        var day = date.getDate();
        return [!(month == 8 && day == 15), ""];
    }
});

DEMO

Upvotes: 4

Related Questions