An input field to enter and edit a date and time value, with configurable input and display formats.

Slots
prefix — Renders content before the input.
suffix — Renders content after the input.
helper-text — Renders content below the input.
value-missing — Renders content when the required validation fails.
range-overflow — Renders content when the max validation fails.
range-underflow — Renders content when the min validation fails.
custom-error — Renders content when a custom message is set with `setCustomValidity()`.
invalid — Renders content when the component is in invalid state (validity.valid = false).
CSS Parts
container — The main wrapper that holds all main input elements.
input — The native input element.
label — The native label element.
prefix — The prefix wrapper.
suffix — The suffix wrapper.
helper-text — The helper text wrapper.
prefixed — Added to the container and the input when an element that is not hidden is in the prefix slot.
suffixed — Added to the container and the input when an element that is not hidden is in the suffix slot.
filled — Added to the container and the input unless the focused input shows only the empty mask.
labelled — Added to the container in the material theme when the control has a label.
start — The wrapper of the prefix in the material theme.
notch — The wrapper of the label in the material theme.
filler — The outline segment between the notch and the end in the material theme.
end — The wrapper of the suffix in the material theme.

The format of the value while the input does not have focus. Without it, the input uses inputFormat when set, else the display format of the locale.

displayFormat: string

The date format of the input while the user edits the value. Without it, the input uses the input format of the locale.

inputFormat: string

The label for the control.

label: string

The locale used to format the display value. Without it, the input takes its own lang, else the locale of the nearest ancestor that has a locale (a component) or a lang, and then the global locale.

locale: string

The maximum value required for the input to remain valid.

max: Date | null

The minimum value required for the input to remain valid.

min: Date | null

Whether the control has an outlined appearance.

outlined: boolean

The placeholder text of the control.

placeholder: string

The amount by which a step action increments or decrements each date part. All values default to 1.

spinDelta: DatePartDeltas | undefined

Whether a spun date part wraps around at its limits. When false, the part stops at its minimum or maximum.

spinLoop: boolean

The value of the input.

Only ever holds a committed value. While the user is typing, the intermediate state lives in the masked text and is committed - together with an igcChange event - when the edit is committed on blur. Use the igcInput event to observe the value as it is being typed.

value: Date | null

Removes focus from the control.

blur(): void

Returns void

Clears the value and the text of the input.

clear(): void

Returns void

Sets focus on the control.

focus(options: FocusOptions): void

Parameters

  • options: FocusOptions

Returns void

Returns whether the input format has a date part: day, month or year.

hasDateParts(): boolean

Returns boolean

Returns whether the input format has a time part: hours, minutes or seconds.

hasTimeParts(): boolean

Returns boolean

Selects all the text inside the input.

select(): void

Returns void

Replaces the text from start to end in the input and re-applies the mask. Without start and end, replaces the selected text. The value updates at once.

setRangeText(replacement: string, start: number, end: number, selectMode: RangeTextSelectMode): void

Parameters

Returns void

Decrements a date or time part by delta, or by its spinDelta value. Without datePart, it changes the part at the cursor or a default part. The value updates at once.

stepDown(datePart: DatePart, delta: number): void

Parameters

Returns void

Decrements a date or time part by delta, or by its spinDelta value. Without datePart, it changes the part at the cursor or a default part. The value updates at once.

stepDown(datePart: P, delta: number): void

Parameters

  • datePart: P
  • delta: number

Returns void

Increments a date or time part by delta, or by its spinDelta value. Without datePart, it changes the part at the cursor or a default part. The value updates at once.

stepUp(datePart: DatePart, delta: number): void

Parameters

Returns void

Increments a date or time part by delta, or by its spinDelta value. Without datePart, it changes the part at the cursor or a default part. The value updates at once.

stepUp(datePart: P, delta: number): void

Parameters

  • datePart: P
  • delta: number

Returns void

Emitted on blur, when the committed value differs from the one the editor was focused with.

onChange(args: CustomEvent<Date | null>): void

Parameters

Returns void

Emitted when the control input receives user input.

onInput(args: CustomEvent<string>): void

Parameters

Returns void