New to Kendo UI for Angular? Start a free 30-day trial

DateTimePickerComponent

Represents the Kendo UI DateTimePicker component for Angular.

Selector

kendo-datetimepicker

Export Name

Accessible in templates as #kendoDateTimePickerInstance="kendo-datetimepicker"

Inputs

animateCalendarNavigation

boolean

(default: false) Determines whether to enable animation when navigating to previous/next Calendar view. Applies to the classic Calendar only.

This feature uses the Web Animations API. In order to run the animation in browsers that do not support it, you need the web-animations-js polyfill.

calendarType

CalendarType

Specifies the Calendar type.

The possible values are:

  • infinite (default)
  • classic

cancelButton

boolean

Determines whether to display the Cancel button in the popup (see example).

disabled

boolean

Sets or gets the disabled property of the DateTimePicker and determines whether the component is active (see example).

disabledDatesValidation

boolean

Determines whether the built-in validator for disabled date ranges is enforced when validating a form (see example).

focusedDate

Date

Specifies the focused date of the popup Calendar (see example).

formatPlaceholder

DateInputFormatPlaceholder

Defines the descriptions of the format sections in the input field (see example).

incompleteDateValidation

boolean

Determines whether the built-in validation for incomplete dates is to be enforced when a form is being validated.

placeholder

string

Specifies the hint which is displayed by the DateTimePicker when its value is null (see example).

rangeValidation

boolean

Determines whether the built-in min or max validators are enforced when validating a form (see example).

readOnlyInput

boolean

Sets the read-only state of the DateTimePicker input field (see example).

Note that if you set the readonly property value to true, the input will be rendered in a read-only state regardless of the readOnlyInput value.

readonly

boolean

Sets the read-only state of the DateTimePicker (see example).

steps

DateInputIncrementalSteps

Configures the incremental steps of the DateInput and the popup component of the TimePicker (see example).

title

string

Sets the title of the input element of the DateTimePicker.

twoDigitYearMax

number

The maximum year to assume to be from the current century when typing two-digit year value (see example).

The default value is 68, indicating that typing any value less than 69 will be assumed to be 20xx, while 69 and larger will be assumed to be 19xx.

weekNumber

boolean

Determines whether to display a week number column in the month view of the popup Calendar (see example).

defaultTab

DateTimePickerActiveTab

Sets the active tab on opening the popup (see example).

disabledDates

(date: Date) => boolean | Date[] | Day[]

Sets the dates of the DateTimePicker that will be disabled (see example).

format

string | FormatSettings

Specifies the date format for displaying the input value (see example)

Format value options:

  • string - Provide a string if a single format is going to be used regardless whether the input is focused or blurred.
  • FormatSettings - To display different formats when the component is focused or blurred, provide a settings object with specified inputFormat and displayFormat values.

If a FormatSettings object is provided, the displayFormat value will be used for the popup TimePicker.

max

Date

Specifies the biggest valid date. The Calendar will not display dates after this value. If the max value of the Calendar is selected, the TimePicker will not display time entries after the specified time portion of this value (see example).

min

Date

Specifies the smallest valid date. The Calendar will not display dates before this value. If the min value of the Calendar is selected, the TimePicker will not display time entries before the specified time portion of this value (see example).

popupSettings

PopupSettings

Configures the popup settings of the DateTimePicker (see example).

The available options are:

  • animate: BooleanControls the popup animation. By default, the open and close animations are enabled.
  • appendTo: 'root' | 'component' | ViewContainerRefControls the popup container. By default, the popup will be appended to the root component.
  • popupClass: StringSpecifies a list of CSS classes that are used to style the popup.

tabindex

number

Specifies the tabindex of the DateTimePicker.

value

Date

Specifies the value of the DateTimePicker component.

The value has to be a valid JavaScript Date instance.

Fields

isActive

boolean

Indicates whether the component or its popup content is focused.

isOpen

boolean

Indicates whether the component is currently open.

Events

close

EventEmitter<PreventableEvent>

Fires each time the popup is about to close. This event is preventable. If you cancel the event by setting event.preventDefault(), the popup will remain open. (more information and example).

blur

EventEmitter<any>

Fires each time the user blurs the component. (more information and example).

focus

EventEmitter<any>

Fires each time the user focuses the component. (more information and example).

open

EventEmitter<PreventableEvent>

Fires each time the popup is about to open. This event is preventable. If you cancel the event by setting event.preventDefault(), the popup will remain closed. (more information and example).

valueChange

EventEmitter<Date>

Fires each time the user selects a new value. (more information and example).

Methods

blur

Blurs the DateTimePicker.

focus

  • If the popup is closed, focuses the DateTimePicker input.
  • If the popup is open, the focus is moved to its content.

toggle

Toggles the visibility of the popup. If you use the toggle method to show or hide the popup, the open and close events do not fire. (more information and example).

Parameters

show?

boolean

The state of the popup.