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.
Definition
Package:@progress/kendo-angular-dateinputs
Selector:kendo-datetimepicker
Export Name:Accessible in templates as #kendo-datetimepickerInstance="kendo-datetimepicker"
Syntax:
@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);
}
Inputs
Enables or disables the adaptive mode. The adaptive rendering is disabled by default.
'none'
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
Determines whether you can see a blinking caret inside the DateInput when possible.
false
animateCalendarNavigation
boolean
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.
false
autoCorrectParts
boolean
Determines whether to auto correct invalid segments automatically.
true
autoFill
boolean
Auto fills the rest of the date to the current date when the component loses focus.
false
autoSwitchKeys
string[]
Specifies custom keys that move the focus to the next date format segment.
[]
autoSwitchParts
boolean
Determines whether to automatically move to the next segment after the user completes the current one.
true
Specifies the Calendar type.
'infinite'
cancelButton
boolean
Determines whether to display the Cancel button in the popup (see example).
true
clearButton
boolean
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.
false
Specifies the active tab when opening the popup (see example).
disabled
boolean
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.
false
disabledDates
Date[] | Day[] | (date: Date) => boolean
Sets the dates of the DateTimePicker that will be disabled (see example).
disabledDatesValidation
boolean
Determines whether the built-in validator for disabled date ranges is enforced when validating a form (see example).
true
enableMouseWheel
boolean
Determines whether you can use the mouse scroll to increase or decrease the time segment values.
true
Specifies the fill mode of the component. The default value is set by the Kendo theme.
focusedDate
Date
Specifies the focused date of the popup Calendar (see example).
footer
boolean
Toggles the visibility of the Calendar footer.
false
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.
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 enforced when validating a form.
false
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).
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
Determines whether the built-in min or max validators are enforced when validating a form
(see example).
true
readonly
boolean
Specifies the read-only state of the DateTimePicker (see example).
false
readOnlyInput
boolean
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.
false
Specifies the border radius of the component. The default value is set by the Kendo theme.
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.
Specifies the size of the component. The default value is set by the Kendo theme.
Configures the incremental steps of the DateInput and the popup component of the TimePicker (see example).
{}
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.
TWO_DIGIT_YEAR_MAX
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.
Sets the format of the displayed Calendar week days' names.
"short"
weekNumber
boolean
Determines whether to display a week number column in the month view of the popup Calendar
(see example).
false
Fields
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
blur
EventEmitter<any>
Fires each time the user blurs the component (see example).
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.
focus
EventEmitter<any>
Fires each time the user focuses the component (see example).
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
Blurs the DateTimePicker component.
Focuses the DateTimePicker input if the popup is closed. Moves the focus to the popup content if the popup is open.
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.
The state of the popup.