Skip to main content

Date time input

Ask AIView as Markdown
Copy a prompt to ask an AI assistant about this page.

Date time input provides a versatile interface for selecting both date and time values, offering a seamless way to input date and time information either as a standalone element or within a dropdown.

Date time input - Code

Basic​

Disabled​

Label​

Readonly​

Validation​

Slots​

Min- and max-date​

Require confirmation​

By default, date time inputs apply every pick immediately and Done closes the picker. Set requireConfirmation to only apply the value when users click Confirm. Cancel, Escape or clicking outside discards the pending selection. Date time inputs emit valueChange only for applied values. Valid values typed into the input field are always applied immediately and emit valueChange.

Display format​

Set displayFormat to show and type the date and time in a different format than format. value, minDate, maxDate and emitted values keep using format. When users type a date, parts missing in displayFormat, like seconds, are kept from the current value. A typed two-digit year resolves to the year closest to the current value.

API for ix-datetime-input​

Properties​

Description

ARIA label for the calendar icon button

Will be set as aria-label on the nested HTML button element

Attribute
aria-label-calendar-button
Type
string | undefined
Default
'Toggle calendar'
Description

ARIA label for next month navigation button

Attribute
aria-label-next-month-button
Type
string | undefined
Default
'Next month'
Description

ARIA label for previous month navigation button

Attribute
aria-label-previous-month-button
Type
string | undefined
Default
'Previous month'
Description

Whether the input is disabled

Attribute
disabled
Type
boolean
Default
false
Since 6.0.0
Description

Luxon date and time format used to display and type the value in the input field.

value, minDate, maxDate and emitted values keep using format,

e.g. format="yyyy/LL/dd HH:mm:ss" with displayFormat="yy/LL/dd HH:mm"

displays a two-digit year without losing the century of the value.

Date and time parts missing in displayFormat, like seconds, are kept

from the current value when the user types a date. A typed two-digit

year resolves to the year closest to the current value.

Defaults to format.

See https://moment.github.io/luxon/#/formatting?id=table-of-tokens for all available tokens.

Attribute
display-format
Type
string | undefined
Description

Enable Popover API rendering for dropdown.

Attribute
enable-top-layer
Type
boolean
Default
false
Description

Luxon date and time format of value, minDate, maxDate and emitted values

(e.g., 'yyyy/LL/dd HH:mm:ss' → "2026/01/20 13:07:04").

See https://moment.github.io/luxon/#/formatting?id=table-of-tokens for all available tokens.

Attribute
format
Type
string
Default
'yyyy/LL/dd HH:mm:ss'
Description

Helper text displayed below the input

Attribute
helper-text
Type
string | undefined
Since 6.0.0
Description

Text for cancel button in picker when requireConfirmation is enabled

Attribute
i18n-cancel
Type
string
Default
'Cancel'
Since 6.0.0
Description

Text for confirm button in picker when requireConfirmation is enabled

Attribute
i18n-confirm
Type
string
Default
'Confirm'
Breaking change in v6.0.0
Default changed from Confirm to Done
Description

Text for done button in picker (prop name matches datetime-picker)

Attribute
i-1-8n-done
Type
string
Default
'Done'
Description

Error message when datetime cannot be parsed

Attribute
i-1-8n-error-date-time-unparsable
Type
string
Default
'Date time is not valid'
Description

Header text for time picker section

Attribute
i-1-8n-time
Type
string
Default
'Time'
Description

Informational message

Attribute
info-text
Type
string | undefined
Description

Validation message for invalid state

Attribute
invalid-text
Type
string | undefined
Description

Label text displayed above the input

Attribute
label
Type
string | undefined
Description

Locale for date/time formatting (e.g., 'en-US', 'de-DE')

Attribute
locale
Type
string | undefined
Description

Maximum allowed date (matching format or date-only, e.g., "2026/12/31")

Attribute
max-date
Type
string | undefined
Since 5.0.0
Description

Latest selectable time (tokens matching the time portion of format). Invalid non-empty values are ignored.

Attribute
max-time
Type
string | undefined
Description

Minimum allowed date (matching format or date-only, e.g., "2026/01/20")

Attribute
min-date
Type
string | undefined
Since 5.0.0
Description

Earliest selectable time (tokens matching the time portion of format). Invalid non-empty values are ignored.

Attribute
min-time
Type
string | undefined
Description

Name of the form control for form submission

Attribute
name
Type
string | undefined
Description

Placeholder text when input is empty

Attribute
placeholder
Type
string | undefined
Description

Whether the input is read-only (calendar icon hidden)

Attribute
readonly
Type
boolean
Default
false
Since 6.0.0
Description

If true, a date and time picked in the dropdown are only applied after the

user confirms them with the confirm button. The cancel button, pressing

Escape or clicking outside the dropdown discards the pending selection.

Attribute
require-confirmation
Type
boolean
Default
false
Description

Whether the field is required

Attribute
required
Type
boolean
Default
false
Description

Show helper text as tooltip instead of below input

Attribute
show-text-as-tooltip
Type
boolean
Default
false
Description

Show week numbers in date picker

Attribute
show-week-numbers
Type
boolean
Default
false
Description

Prevent form submission when Enter is pressed

Attribute
suppress-submit-on-enter
Type
boolean
Default
false
Description

Text alignment within the input field

Attribute
text-alignment
Type
"end" | "start"
Default
'start'
Description

Success/valid message

Attribute
valid-text
Type
string | undefined
Description

Value in format (e.g., "2026/01/21 13:07:04" for default format)

Attribute
value
Type
string | undefined
Default
''
Description

Warning message

Attribute
warning-text
Type
string | undefined
Description

First day of week (0=Sunday, 1=Monday, etc.)

Attribute
week-start-index
Type
number
Default
0

Events​

Description

Emitted when the input loses focus

Event
ixBlur
Detail
void
Breaking change in v6.0.0
Emitted once when the picker closes, or on Confirm with requireConfirmation
Description

Emitted when the date/time value changes via user interaction.

Fires in two scenarios:

  • When the input loses focus (blur) and the value has changed

  • When the picker closes after the value was changed in it, or on

    Confirm when requireConfirmation is enabled

Does NOT fire when:

  • The picker is opened/closed without changing the value

  • The input is blurred without modifying the value

  • The value is changed programmatically via the value property

Event
ixChange
Detail
string | undefined
Description

Emitted when the input receives focus

Event
ixFocus
Detail
void
Description

Emitted when validation state changes

Event
validityStateChange
Detail
DateTimeInputValidityState
Breaking change in v6.0.0
Emit timing changed for picker selections
Description

Emitted when the datetime value changes. Payload is in format or undefined

Event
valueChange
Detail
string | undefined

Slot​

Description

Element will be displayed at the end of the input

Description

Element will be displayed at the start of the input