ASP.NET MVC Controls | ComponentOne
Working with Controls / Input Controls / InputDateRange / Day Range
In This Topic
    Day Range
    In This Topic

    InputDateRange lets you to customize the dropdown calendar to show a limited set of days in the visible calendar month(s) and restrict the selection to the specified range of dates from the calendar. This can be done using the RangeMin and RangeMax properties. The RangeMin and RangeMax properties allow you to limit the minimum and maximum number of days to be displayed in the selected date range at runtime, respectively.

    The following code uses the RangeMin and RangeMax properties to display a minimum three days and maximum five days in the selected date range in the control:

    C#
    Copy Code
    @{
        var today = DateTime.Now.Date;
        var rangeEnd = today.AddDays(3);
    }
    
    @(Html.C1().InputDateRange().Id("demoControl")
            .CloseOnSelection(false)
            .SelectionMode(DateSelectionMode.Range)
            .Value(today)
            .RangeEnd(rangeEnd)
            .RangeMin(3)
            .RangeMax(5)
    )