Edit this page

DateTimePicker Tag Helper

The DateTimePicker tag helper helps you configure the Kendo UI DateTimePicker widget in ASP.NET Core applications.

Basic Usage

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

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

Configuration

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

Example

        @(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.

    Example
        @{
            ViewBag.ParseDates = new string[] { "MMMM yyyy", "MMMM" };
        }
    
        <kendo-datetimepicker name="datetimepicker" parse-formats="ViewBag.ParseDates"></kendo-datetimepicker>
    

See Also