New to Telerik UI for ASP.NET Core? Download free 30-day trial

DateTimePickerBuilder

Defines the fluent API for configuring the Kendo UI DateTimePicker

Properties

WriteAction - Func

Methods

Animation(System.Boolean)

Use to enable or disable animation of the popup element.

Parameters

enable - System.Boolean

The boolean value.

Example


            @(Html.Kendo().DatePicker()
                       .Name("DatePicker")
                       .Animation(false) //toggle effect
            )

Animation(System.Action)

Configures the animation effects of the widget.

Parameters

animationAction - System.Action<PopupAnimationBuilder>

The action which configures the animation effects.

Example


            @(Html.Kendo().DatePicker()
                       .Name("DatePicker")
                       .Animation(animation =>
                       {
                            animation.Open(open =>
                            {
                                open.SlideIn(SlideDirection.Down);
                            })
                       })
            )

BindTo(System.Collections.Generic.IEnumerable)

Binds the TimeView to a list of DateTime objects.

Parameters

dates - System.Collections.Generic.IEnumerable<DateTime>

The dates.

Example


            @(Html.Kendo().DatePicker()
                       .Name("DateTimePicker")
                       .BindTo(new List<DateTime> { DateTime.Now })
            )

DisableDates(System.Collections.Generic.IEnumerable)

Parameters

disableDates - System.Collections.Generic.IEnumerable<String>

DisableDates(System.DayOfWeek[])

Specifies the disabled dates in the DateTimePicker widget.

Parameters

days - System.DayOfWeek[]

Example


            @(Html.Kendo().DateTimePicker()
                        .Name("dateTimePicker")
                        .DisableDates(DayofWeek.Saturday, DayOfWeek.Sunday)
            )

DisableDates(System.String)

Specifies the disabled dates in the DateTimePicker widget using a function.

Parameters

handler - System.String

Example


            @( Html.Kendo().DateTimePicker()
                        .Name("dateTimePicker")
                        .DisableDates("disableDates")
            )

Value(System.String)

Sets the value of the picker input

Parameters

date - System.String

Value(System.Nullable)

Specifies the selected value.

Parameters

value - System.Nullable<DateTime>

The value that configures the value.

Enable(System.Boolean)

Enables or disables the picker.

Parameters

value - System.Boolean

Footer(System.Boolean)

Enables/disables footer of the calendar popup.

Parameters

footer - System.Boolean

FooterId(System.String)

FooterId to be used for rendering the footer of the Calendar.

Parameters

id - System.String

Example


            @(Html.Kendo().DateTimePicker()
                        .Name("DateTimePicker")
                        .FooterId("widgetFooterId")
            )

Min(System.String)

Sets the minimal date, which can be selected in DatePicker.

Parameters

date - System.String

Max(System.String)

Sets the maximal date, which can be selected in DatePicker.

Parameters

date - System.String

MonthTemplateId(System.String)

MonthTemplateId to be used for rendering the cells of the Calendar.

Parameters

id - System.String

Example


             @(Html.Kendo().DateTimePicker()
                        .Name("DateTimePicker")
                        .MonthTemplateId("widgetMonthTemplateId")
            )

MonthTemplate(System.String)

Templates for the cells rendered in the "month" view.

Parameters

content - System.String

Example


            @(Html.Kendo().DateTimePicker()
                        .Name("DateTimePicker")
                        .MonthTemplate("#= data.value #")
            )

ARIATemplate(System.String)

Specifies a template used to populate value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value..

Parameters

value - System.String

The value for ARIATemplate

ARIATemplateId(System.String)

Specifies a template used to populate value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value..

Parameters

templateId - System.String

The ID of the template element for ARIATemplate

ComponentType(System.String)

Specifies the component type of the widget. "classic" - Uses the standard rendering of the widget. or "modern" - Uses new rendering with a fresh and modern look and feel..

Parameters

value - System.String

The value for ComponentType

Culture(System.String)

Specifies the culture info used by the widget.

Parameters

value - System.String

The value for Culture

DateInput(System.Boolean)

Specifies if the DateTimePicker will use DateInput for editing value

Parameters

value - System.Boolean

The value for DateInput

DateInput()

Specifies if the DateTimePicker will use DateInput for editing value

Dates(System.DateTime[])

Specifies a list of dates, which will be passed to the month template of the DateView. All dates, which match the date portion of the selected date will be used to re-bind the TimeView.

Parameters

value - System.DateTime[]

The value for Dates

Footer(System.String)

The template which renders the footer of the calendar. If false, the footer will not be rendered.

Parameters

value - System.String

The value for Footer

Format(System.String)

Specifies the format, which is used to format the value of the DateTimePicker displayed in the input. The format also will be used to parse the input.For more information on date and time formats please refer to Date Formatting.

Parameters

value - System.String

The value for Format

Interval(System.Double)

Specifies the interval, between values in the popup list, in minutes.

Parameters

value - System.Double

The value for Interval

Max(System.DateTime)

Specifies the maximum date, which the calendar can show.

Parameters

value - System.DateTime

The value for Max

Messages(System.Action)

Allows localization of the strings that are used in the widget.

Parameters

configurator - System.Action<DateTimePickerMessagesSettingsBuilder>

The configurator for the messages setting.

Min(System.DateTime)

Specifies the minimum date that the calendar can show.

Parameters

value - System.DateTime

The value for Min

Popup(System.Action)

The options that will be used for the popup initialization. For more details about the available options refer to Popup documentation.

Parameters

configurator - System.Action<DateTimePickerPopupSettingsBuilder>

The configurator for the popup setting.

WeekNumber(System.Boolean)

If set to true a week of the year will be shown on the left side of the calendar. It is possible to define a template in order to customize what will be displayed.

Parameters

value - System.Boolean

The value for WeekNumber

WeekNumber()

If set to true a week of the year will be shown on the left side of the calendar. It is possible to define a template in order to customize what will be displayed.

ParseFormats(System.String[])

Specifies the formats, which are used to parse the value set with value() method or by direct input. If not set the value of the options.format and options.timeFormat will be used. Note that value of the format option is always used. The timeFormat value also will be used if defined.

Parameters

value - System.String[]

The value for ParseFormats

TimeFormat(System.String)

Specifies the format, which is used to format the values in the time drop-down list.

Parameters

value - System.String

The value for TimeFormat

Value(System.DateTime)

Specifies the selected value.

Parameters

value - System.DateTime

The value for Value

Start(Kendo.Mvc.UI.CalendarView)

Represents available types of calendar views.

Parameters

value - CalendarView

The value for Start

Depth(Kendo.Mvc.UI.CalendarView)

Specifies the navigation depth.

Parameters

value - CalendarView

The value for Depth

MonthTemplate(System.Action)

Parameters

configurator - System.Action<DateTimePickerMonthTemplateSettingsBuilder>

The configurator for the monthtemplate setting.

Size(Kendo.Mvc.UI.ComponentSize)

Sets the size of the component.

Parameters

value - ComponentSize

The value for Size

Rounded(Kendo.Mvc.UI.Rounded)

Sets a value controlling the border radius.

Parameters

value - Rounded

The value for Rounded

FillMode(Kendo.Mvc.UI.FillMode)

Sets a value controlling how the color is applied.

Parameters

value - FillMode

The value for FillMode

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<DateTimePickerEventBuilder>

The client events action.

Example


            @(Html.Kendo().DateTimePicker()
                  .Name("DateTimePicker")
                  .Events(events => events
                      .Change("onChange")
                  )
            )

ToComponent()

Returns the internal view component.

Expression(System.String)

Sets the name of the component.

Parameters

modelExpression - System.String

Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

Parameters

modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name.

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The HTML attributes.

Render()

Renders the component in place.

ToHtmlString()

WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

Parameters

writer - System.IO.TextWriter
encoder - System.Text.Encodings.Web.HtmlEncoder

ToClientTemplate()

In this article
Not finding the help you need?