New to Kendo UI for AngularStart a free 30-day trial

DateTimePickerComponent

Represents the Kendo UI DateTimePicker component for Angular. Allows users to select both date and time values from an interactive calendar and time selector.

typescript
@Component({
  selector: 'my-app',
  template: `
    <kendo-datetimepicker
      [(value)]="dateTimeValue"
      [format]="'g'"
      [min]="minDate"
      [max]="maxDate">
    </kendo-datetimepicker>
  `
})
export class AppComponent {
  public dateTimeValue: Date = new Date();
  public minDate: Date = new Date(2000, 0, 1);
  public maxDate: Date = new Date(2030, 11, 31);
}

Selector

kendo-datetimepicker

Export Name

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

Inputs

NameTypeDefaultDescription

adaptiveMode

AdaptiveMode

'none'

Enables or disables the adaptive mode. The adaptive rendering is disabled by default.

adaptiveSubtitle

string

''

Specifies the subtitle text rendered in the header of the popup (action sheet). Applicable only when AdaptiveMode is set to auto.

adaptiveTitle

string

''

Specifies the title of the input element of the DateTimePicker and the title text rendered in the header of the popup (action sheet). Applicable only when AdaptiveMode is set to auto.

allowCaretMode

boolean

false

Determines whether you can see a blinking caret inside the DateInput when possible.

animateCalendarNavigation

boolean

false

Determines whether to enable animation when navigating to previous/next Calendar view. Applies to the classic Calendar only.

The 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.

autoCorrectParts

boolean

true

Determines whether to auto correct invalid segments automatically.

autoFill

boolean

false

Auto fills the rest of the date to the current date when the component loses focus.

autoSwitchKeys

string[]

Specifies custom keys that move the focus to the next date format segment.

autoSwitchParts

boolean

true

Determines whether to automatically move to the next segment after the user completes the current one.

calendarType

CalendarType

'infinite'

Specifies the Calendar type.

cancelButton

boolean

true

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

clearButton

boolean

false

Renders a clear button when set to true after the input text or DateTimePicker value has been changed. Clicking this button resets the value of the component to null and triggers the valueChange event.

defaultTab

DateTimePickerActiveTab

Specifies the active tab when opening the popup (see example).

disabled

boolean

false

Specifies the disabled property of the DateTimePicker and determines whether the component is active (see example). To learn how to disable the component in reactive forms, refer to the article on Forms Support.

disabledDates

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

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

disabledDatesValidation

boolean

true

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

enableMouseWheel

boolean

true

Determines whether you can use the mouse scroll to increase or decrease the time segment values.

fillMode

DateInputFillMode

Specifies the fill mode of the component.

focusedDate

Date

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

boolean

false

Toggles the visibility of the Calendar footer.

format

string | FormatSettings

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

When using a string format, the same format is applied regardless of whether the input is focused or blurred. When using a FormatSettings object, you can specify different inputFormat and displayFormat values for focused and blurred states.

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

formatPlaceholder

DateInputFormatPlaceholder

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

incompleteDateValidation

boolean

false

Determines whether the built-in validation for incomplete dates is enforced when validating a form.

inputAttributes

{[key: string]: string}

Specifies the HTML attributes of the inner focusable input element. You cannot change attributes that are essential for certain component functionalities.

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).

placeholder

string

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

popupSettings

PopupSettings

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

The available options are animate which controls the popup animation and by default, the open and close animations are enabled. The appendTo option controls the popup container and by default, the popup will be appended to the root component. The popupClass option specifies a list of CSS classes that are used to style the popup.

rangeValidation

boolean

true

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

readonly

boolean

false

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

readOnlyInput

boolean

false

Determines whether the input field of the DateTimePicker is read-only (see example).

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

rounded

DateInputRounded

Specifies the border radius of the component.

showOtherMonthDays

boolean

Displays the days that fall out of the current month in the Calendar (see example). You can set this to show or hide days from other months.

For infinite Calendar the default value is false, while for classic Calendar it is true.

size

DateInputSize

Specifies the size of the component.

steps

DateInputIncrementalSteps

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

tabindex

number

Specifies the tabindex of the DateTimePicker.

twoDigitYearMax

number

68

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.

value

Date

Sets the value of the DateTimePicker component. You can set a specific date and time for the picker to display and use.

The value has to be a valid JavaScript Date instance or null.

weekDaysFormat?

WeekDaysFormat

'short'

Sets the format of the displayed Calendar week days' names.

weekNumber

boolean

false

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

Fields

NameTypeDefaultDescription

isActive

boolean

Indicates whether the component or its popup content is focused.

isOpen

boolean

Indicates whether the component is currently open. This is when the popup or action sheet is open.

Events

NameTypeDescription

close

EventEmitter<PreventableEvent>

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

blur

EventEmitter<any>

Fires each time the user blurs the component (see example).

focus

EventEmitter<any>

Fires each time the user focuses the component (see example).

open

EventEmitter<PreventableEvent>

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

valueChange

EventEmitter<Date>

Fires each time the user selects a new value (see example).

Methods

blur

Blurs the DateTimePicker component.

focus

Focuses the DateTimePicker input if the popup is closed. Moves the focus to the popup content if the popup is open.

toggle

Toggles the visibility of the popup or action sheet. If you use the toggle method to show or hide the popup or action sheet, the open and close events do not fire.

Parameters

show?

boolean

The state of the popup.

In this article
SelectorExport NameInputsFieldsEventsMethods
Not finding the help you need?
Contact Support