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

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

Constructors

Properties

dir: Direction = 'auto'

The direction attribute of the control.

Attr

disabled: boolean = false

Makes the control a disabled field.

Attr

displayFormat: string

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

Attr

display-format

invalid: boolean = false

Controls the validity of the control.

label: string

The label for the control.

Attr

locale: string = 'en'

The locale settings used to display the value.

Attr

maxValue: null | Date

The maximum value required for the input to remain valid.

Attr

max-value

minValue: null | Date

The minimum value required for the input to remain valid.

Attr

min-value

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

required: boolean = false

Makes the control a required field.

Attr

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

Determines the size of the component.

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 value(): null | Date
  • The value of the input.

    Attr

    Returns null | Date

  • set value(val: null | Date): void
  • Parameters

    • val: null | Date

    Returns void

Methods

  • Removes focus from the control.

    Returns void

  • Type Parameters

    • K extends keyof IgcDateTimeInputEventMap

    • D extends null | string | void | Date

    Parameters

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

    Returns boolean

  • 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

  • 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 input.

    Parameters

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

    Returns void

  • Parameters

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

    Returns void

  • Parameters

    • controller: ThemeController

    Returns void