Mitchell Y
Mitchell Y

Reputation: 113

Disable future date in Kendo UI Calendar Widget

How is it possible to disable (basically i mean just greying out) future dates in Kendo UI Calendar widget? I have only tried to hide future dates but it does not seem to look good and I have tried various way to grey it out but not finding the proper method? Any ideas will be really appreciated.

Upvotes: 2

Views: 2862

Answers (1)

DontVoteMeDown
DontVoteMeDown

Reputation: 21465

The disableDates options(that you have find out by yourself) function expects to be told whenever it should display the day. So you have to return true if it is a valid date, e.g.:

disableDates: function (date) {
    return (date && date.getTime() > (new Date()).getTime());
}

Demo

Upvotes: 2

Related Questions