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.

igc-date-time-input

prefix - Renders content before the input.

suffix - Renders content after 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 setCustomValidity(message) is set.

invalid - Renders content when the component is in invalid state (validity.valid = false).

igcInput - Emitted when the control input receives user input.

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

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.

Hierarchy

Hierarchy

  • EventEmitterInterface<IgcDateTimeInputComponentEventMap, this> & IgcDateTimeInputBaseComponent<
        this,
    >
    • IgcDateTimeInputComponent

Properties

disabled: boolean

The disabled state of the component.

false
invalid: boolean

Sets the control into invalid state (visual state only).

false
label: string

The label for the control.

name: string

The name attribute of the control.

outlined: boolean = false

Whether the control will have outlined appearance.

false
placeholder: string

The placeholder attribute of the control.

readOnly: boolean

Makes the control a readonly field.

readonly

false
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.

spin-loop

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

The tagName read-only property of the Element interface returns the tag name of the element on which it's called.

MDN Reference

Accessors

  • set defaultValue(value: unknown): void

    The initial value of the component.

    Parameters

    • value: unknown

    Returns void

  • set displayFormat(value: string): void

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

    display-format

    Parameters

    • value: string

    Returns void

  • get form(): HTMLFormElement | null

    Returns the HTMLFormElement associated with this element.

    Returns HTMLFormElement | null

  • get inputFormat(): string

    The date format to apply on the input.

    input-format

    Returns string

  • set locale(value: string): void

    Gets/Sets the locale used for formatting the display value.

    locale

    Parameters

    • value: string

    Returns void

  • get mask(): string

    The mask pattern of the component.

    Returns string

  • set max(value: string | Date | null | undefined): void

    The maximum value required for the input to remain valid.

    Parameters

    • value: string | Date | null | undefined

    Returns void

  • set min(value: string | Date | null | undefined): void

    The minimum value required for the input to remain valid.

    Parameters

    • value: string | Date | null | undefined

    Returns void

  • get prompt(): string

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

    '_'
    

    Returns string

  • set required(value: boolean): void

    When set, makes the component a required field for validation.

    false
    

    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

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

    Returns boolean

  • Clears the input element of user input.

    Returns void

  • Sets focus on the control.

    Parameters

    • options: FocusOptions

    Returns void

  • Checks whether the current format includes date parts (day, month, year).

    Returns boolean

  • Checks whether the current format includes time parts (hours, minutes, seconds).

    Returns boolean

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

    Returns boolean

  • Selects all the text inside 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
    • start: number
    • end: number
    • selectMode: RangeTextSelectMode

    Returns void

  • Sets the text selection range of the control.

    Parameters

    • start: number
    • end: number
    • direction: SelectionRangeDirection

    Returns void

  • Decrements a date/time portion.

    Parameters

    Returns void

  • Increments a date/time portion.

    Parameters

    Returns void