ASP.NET Core DateRangePicker Overview

Telerik UI for ASP.NET Core Ninja image

The DateRangePicker is part of Telerik UI for ASP.NET Core, a professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.

The Telerik UI DateRangePicker TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers 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.

Basic Configuration

The following example demonstrates the basic configuration for the 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.
     <kendo-daterangepicker name="daterangepicker" 
                            min="new DateTime(1900, 1, 1)"
                            max="new DateTime(2099, 12, 31)">
             <range start="DateTime.Now" end="DateTime.Now.AddDays(10)"/>

Functionality and Features

Feature Description
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 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 The DateRangePicker enables you to set the initially rendered view and define the navigation depth of the views.
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 The DateRangePicker allows you to define its date formatting.
Calendar types The DateRangePicker works with Date objects which support only the Gregorian calendar.
Week number column The DateRangePicker provides options for rendering a column which displays the number of the weeks within the current Month view.
Globalization The DateRangePicker comes with globalization support that allows you to use the component in apps all over the world.
Accessibility The DateRangePicker is accessible for screen readers, supports WAI-ARIA attributes, and delivers keyboard shortcuts for faster navigation.

Referencing Existing Instances

To reference an existing DateRangePicker instance, use the method. Once a reference has been established, use the DateRangePicker client-side API to control its behavior.

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

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

Next Steps

See Also

In this article