Class IgcDateTimeInputComponent

A date time input is an input field that lets you set and edit the date and time in a chosen input element using customizable display and input formats.

Element

igc-date-time-input

Slot

prefix - Renders content before the input.

Slot

suffix - Renders content after input.

Slot

helper-text - Renders content below the input.

Fires

igcInput - Emitted when the control input receives user input.

Fires

igcChange - Emitted when the control's checked state changes.

Fires

igcFocus - Emitted when the control gains focus.

Fires

igcBlur - Emitted when the control loses focus.

Csspart

container - The main wrapper that holds all main input elements.

Csspart

input - The native input element.

Csspart

label - The native label element.

Csspart

prefix - The prefix wrapper.

Csspart

suffix - The suffix wrapper.

Csspart

helper-text - The helper text wrapper.

Hierarchy

Hierarchy

  • EventEmitterInterface<IgcDateTimeInputEventMap, this> & IgcMaskInputBaseComponent<this>
    • IgcDateTimeInputComponent

Constructors

Properties

disabled: boolean

The disabled state of the component

Attr

[disabled=false]

displayFormat: string

Format to display the value in when not editing. Defaults to the input format if not set.

Attr

display-format

invalid: boolean

Control the validity of the control.

Attr

label: string

The label for the control.

Attr

locale: string = 'en'

The locale settings used to display the value.

Attr

max: Date

The maximum value required for the input to remain valid.

Attr

min: Date

The minimum value required for the input to remain valid.

Attr

name: string

The name attribute of the control.

Attr

outlined: boolean = false

Whether the control will have outlined appearance.

Attr

placeholder: string

The placeholder attribute of the control.

Attr

prompt: string

The prompt symbol to use for unfilled parts of the mask.

readOnly: boolean = false

Makes the control a readonly field.

Attr

readonly

required: boolean

Makes the control a required field in a form context.

Attr

size: "small" | "medium" | "large"

Determines the size of the component.

Attr

Deprecated

since v4.5.0. Use the --ig-size CSS custom property instead.

spinDelta: DatePartDeltas

Delta values used to increment or decrement each date part on step actions. All values default to 1.

spinLoop: boolean = true

Sets whether to loop over the currently spun segment.

Attr

spin-loop

tagName: "igc-date-time-input" = 'igc-date-time-input'

Accessors

  • get form(): null | HTMLFormElement
  • Returns the HTMLFormElement associated with this element.

    Returns null | HTMLFormElement

  • get readonly(): boolean
  • Returns boolean

  • set readonly(value): void
  • Makes the control a readonly field.

    Deprecated

    since v4.4.0. Use the readOnly property instead.

    Parameters

    • value: boolean

    Returns void

  • get validationMessage(): string
  • A string containing the validation message of this element.

    Returns string

  • get validity(): ValidityState
  • Returns a ValidityState object which represents the different validity states the element can be in, with respect to constraint validation.

    Returns ValidityState

  • get willValidate(): boolean
  • A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.

    Returns boolean

Methods

  • Removes focus from the control.

    Returns void

  • Checks for validity of the control and emits the invalid event if it invalid.

    Returns boolean

  • Returns void

  • Type parameters

    Type Parameters

    • K extends keyof IgcDateTimeInputEventMap
    • D extends null | string | void | Date

    Parameters

    • type: K
    • Optional eventInitDict: CustomEventInit<D>

    Returns boolean

  • Type parameters

    Type Parameters

    • K extends keyof IgcInputEventMap
    • D extends string | void

    Parameters

    • type: K
    • Optional eventInitDict: CustomEventInit<D>

    Returns boolean

  • Sets focus on the control.

    Parameters

    • Optional options: FocusOptions

    Returns void

  • Checks for validity of the control and shows the browser message if it invalid.

    Returns boolean

  • Selects all text within the input.

    Returns void

  • Sets a custom validation message for the control. As long as message is not empty, the control is considered invalid.

    Parameters

    • message: string

    Returns void

  • Replaces the selected text in the control and re-applies the mask

    Parameters

    • replacement: string
    • Optional start: number
    • Optional end: number
    • Optional selectMode: "end" | "start" | "select" | "preserve"

    Returns void

  • Parameters

    • start: number
    • end: number
    • Optional direction: "none" | "forward" | "backward"

    Returns void