Date Range in Calendar Control

19 Dec 20221 minute to read

Calendar provides an option to select a date value within a specified range by defining the min and max properties. The min date should always be lesser than the max date. If the value of min or max properties are changed through code behind, then update the value property to be set within the specified range. Or else, if the value is out of specified date range and less than min date, value property will be updated with min date or the value is higher than max date, value property will be updated with max date.

@{
    var minDate= new DateTime(DateTime.Now.Year,DateTime.Now.Month,07);
    var maxDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 27);
    var value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 14);
}

<ejs-calendar id="calendar" value="value" min="minDate" max="maxDate"></ejs-calendar>

NOTE

View Sample in GitHub.