# ASP.NET MVC DateRangePicker Overview

The Telerik UI DateRangePicker HtmlHelper for ASP.NET MVC is a server-side wrapper for the Kendo UI DateRangePicker widget.

The DateRangePicker is a container for holding start and end date inputs. It allows the user to select a date range from a calendar or through a direct input. The helper also supports custom templates for its `month` view, configuration options for minimum and maximum dates, a start view, and a depth for navigation.

* [Demo page for the DateRangePicker HtmlHelper](https://demos.telerik.com/aspnet-mvc/daterangepicker/index)

## Basic Configuration

The following example demonstrates the basic configuration for the DateRangePicker.

```Razor HtmlHelper
    @(Html.Kendo().DateRangePicker()
        .Name("daterangepicker") // The name of the DateRangePicker is mandatory. It specifies the "id" attribute of the DateRangePicker.
        .Min(new DateTime(1900, 1, 1)) // Sets the min date of the DateRangePicker.
        .Max(new DateTime(2099, 12, 31)) // Sets the min date of the DateRangePicker.
        .Range(r => r.Start(DateTime.Now).End(DateTime.Now.AddDays(10))) // Sets the range of the DateRangePicker.
    )
```

## Functionality and Features

| Feature                                                                                                                            | Description                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Disabled dates](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/disabled-dates)             | The DateRangePicker allows you to disable specific days that shouldn't be selected by the end user, such as weekends and national holidays.                                                                                                               |
| [Selected dates](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/selected-dates)             | The DateRangePicker allows you to define the minimum and maximum dates it displays and also render a pre-selected date range.                                                                                                                             |
| [Start view and navigation depth](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/nav-depth) | The DateRangePicker enables you to set the initially rendered view and define the navigation depth of the views.                                                                                                                                          |
| [Validation](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/validation)                     | The DateRangePicker does not automatically update the typed text when the typed text is invalid. Such changes in the input value may lead to unexpected behavior.                                                                                         |
| [Date formatting](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/date-formatting)           | The DateRangePicker allows you to define its date formatting.                                                                                                                                                                                             |
| [Calendar types](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/calendar-types)             | The DateRangePicker works with `Date` objects which support only the [Gregorian](https://en.wikipedia.org/wiki/Gregorian_calendar) calendar.                                                                                                              |
| [Week number column](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/week-num-column)        | The DateRangePicker provides options for rendering a column which displays the number of the weeks within the current `Month` view.                                                                                                                       |
| [Globalization](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/globalization/overview)      | The DateRangePicker comes with globalization support that allows you to use the component in apps all over the world.                                                                                                                                     |
| [Accessibility](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/accessibility/overview)      | The DateRangePicker is accessible for screen readers, supports WAI-ARIA attributes, and delivers [keyboard shortcuts](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/accessibility/key-nav) for faster navigation. |
| [Reverse Selection](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/reverse-selection)       | The component allows you to pick an end date which is before the start date.                                                                                                                                                                              |
| [Buttons](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/buttons)                           | Learn more about the buttons supported by the component.                                                                                                                                                                                                  |
| [Automatic Correction](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/auto-adjust)          | You can configure whether the component will autocorrect the user's input when the `Min` and `Max` values are set.                                                                                                                                        |

## Referencing Existing Instances

To reference an existing DateRangePicker instance, use the [`jQuery.data()`](http://api.jquery.com/jQuery.data/) method. Once a reference has been established, use the [DateRangePicker client-side API](https://docs.telerik.com/kendo-ui/api/ui/daterangepicker#methods) to control its behavior.

The following example demonstrates how to access an existing DateRangePicker instance.

```
    // Place the following after the DateRangePicker for ASP.NET MVC declaration.
    <script>
    $(function() {
    // The Name() of the DateRangePicker is used to get its client-side instance.
        var daterangepicker = $("#daterangepicker").data("kendoDateRangePicker");
    });
    </script>
```

## Next Steps

* [Getting Started with the DateRangePicker](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/daterangepicker/getting-started)
* [Basic Usage of the DateRangePicker HtmlHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/daterangepicker/index)

## See Also

* [Using the API of the DateRangePicker for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/daterangepicker/api)
* [Knowledge Base Section](https://www.telerik.com/aspnet-mvc/documentation/knowledge-base)
