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
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
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 totrue
, the input will be rendered in a read-only state regardless of thereadOnlyInput
value.
readonly
boolean
Sets the read-only state of the DateTimePicker (see example).
steps
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
Sets the active tab on opening the popup (see example).
disabledDates
Date[] | Day[] | (date: Date) => boolean
Sets the dates of the DateTimePicker that will be disabled (see example).
fillMode
Sets the fillMode of the component.
The possible values are:
solid
(Default)flat
outline
none
format
string | FormatSettings
Specifies the date format for displaying the input value (see example)
Format value options:
string
- Provide astring
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 specifiedinputFormat
anddisplayFormat
values.
If a
FormatSettings
object is provided, thedisplayFormat
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
Configures the popup settings of the DateTimePicker (see example).
The available options are:
animate: Boolean
—Controls the popup animation. By default, the open and close animations are enabled.appendTo: 'root' | 'component' | ViewContainerRef
—Controls the popup container. By default, the popup will be appended to the root component.popupClass: String
—Specifies a list of CSS classes that are used to style the popup.
rounded
Sets the border radius of the component.
The possible values are:
small
medium
(Default)large
full
none
size
Sets the size of the component.
The possible values are:
small
medium
(Default)large
none
tabindex
number
Specifies the tabindex
of the DateTimePicker.
value
Date
Specifies the value of the DateTimePicker component.
The
value
has to be a valid JavaScriptDate
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
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
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.