DateTimePicker TagHelper Overview

The Telerik UI DateTimePicker TagHelper for ASP.NET Core is a server-side wrapper for the Kendo UI DateTimePicker widget.

The DateTimePicker allows the user to select a value from a calendar, a time drop-down list, or through direct input.

Initializing the DateTimePicker

The following example demonstrates how to define the DateTimePicker by using the DateTimePicker TagHelper.

    <kendo-datetimepicker name="timepicker1"></kendo-datetimepicker>

Basic Configuration

The DateTimePicker TagHelper configuration options are passed as attributes of the tag.


        @(Html.Kendo().DateTimePicker()
                .Name("end")
                .Value(DateTime.Today)
                .Min(DateTime.Today)
                .Events(e => e.Change("endChange"))
        )
        <kendo-datetimepicker name="end" value="DateTime.Today"
            min="DateTime.Today" on-change="endChange">
        </kendo-datetimepicker>

The ParseFormats option is of type string[] and can be assigned either by a ViewBag property or by a property of the model.

    @{
        ViewBag.ParseDates = new string[] { "MMMM yyyy", "MMMM" };
    }

    <kendo-datetimepicker name="datetimepicker" parse-formats="ViewBag.ParseDates"></kendo-datetimepicker>

See Also

In this article
Not finding the help you need? Improve this article