igc-date-picker is a feature rich component used for entering a date through manual text input or choosing date values from a calendar dialog that pops up.

Element
igc-date-picker
Slots
prefix — Renders content before the input.
suffix — Renders content after the input.
helper-text — Renders content below the input.
bad-input — Renders content when the value is in the disabledDates ranges.
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).
title — Renders content in the calendar title.
header-date — Renders content instead of the current date/range in the calendar header.
clear-icon — Renders a clear icon template.
calendar-icon — Renders the icon/content for the calendar picker.
calendar-icon-open — Renders the icon/content for the picker in open state.
actions — Renders content in the action part of the picker in open state.
CSS Parts
label — The label wrapper that renders content above the target input.
container — The main wrapper that holds all main input elements.
input — The native input element.
prefix — The prefix wrapper.
suffix — The suffix wrapper.
calendar-icon — The calendar icon wrapper for closed state.
calendar-icon-open — The calendar icon wrapper for opened state.
clear-icon — The clear icon wrapper.
actions — The actions wrapper.
helper-text — The helper-text wrapper that renders content below the target input.
header — The calendar header element.
header-title — The calendar header title element.
header-date — The calendar header date element.
calendar-content — The calendar content element which contains the views and navigation elements.
navigation — The calendar navigation container element.
months-navigation — The calendar months navigation button element.
years-navigation — The calendar years navigation button element.
years-range — The calendar years range element.
navigation-buttons — The calendar navigation buttons container.
navigation-button — The calendar previous/next navigation button.
days-view-container — The calendar days view container element.
days-view — The calendar days view element.
months-view — The calendar months view element.
years-view — The calendar years view element.
days-row — The calendar days row element.
calendar-label — The calendar week header label element.
week-number — The calendar week number element.
week-number-inner — The calendar week number inner element.
date — The calendar date element.
date-inner — The calendar date inner element.
first — The calendar first selected date element in range selection.
last — The calendar last selected date element in range selection.
inactive — The calendar inactive date element.
hidden — The calendar hidden date element.
weekend — The calendar weekend date element.
range — The calendar range selected element.
special — The calendar special date element.
disabled — The calendar disabled date element.
single — The calendar single selected date element.
preview — The calendar range selection preview date element.
month — The calendar month element.
month-inner — The calendar month inner element.
year — The calendar year element.
year-inner — The calendar year inner element.
selected — The calendar selected state for element(s). Applies to date, month and year elements.
current — The calendar current state for element(s). Applies to date, month and year elements.

IgcDatePickerComponent

new IgcDatePickerComponent(): IgcDatePickerComponent

Defined in src/components/date-picker/date-picker.ts:511

Returns IgcDatePickerComponent

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

The disabled state of the component.

disabled: boolean

Defined in src/components/common/mixins/forms/types.ts:29

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

emitEvent: object & object

Defined in src/components/common/mixins/event-emitter.ts:30, src/components/common/mixins/combo-box.ts:16

The orientation of the calendar header.

headerOrientation: CalendarHeaderOrientation = 'horizontal'

Defined in src/components/date-picker/date-picker.ts:362

Determines whether the calendar hides its header.

hideHeader: boolean = false

Defined in src/components/date-picker/date-picker.ts:376

Controls the visibility of the dates that do not belong to the current month.

hideOutsideDays: boolean = false

Defined in src/components/date-picker/date-picker.ts:383

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

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

invalid: boolean

Defined in src/components/common/mixins/forms/types.ts:36

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

Whether the component dropdown should be kept open on clicking outside of it.

keepOpenOnOutsideClick: boolean = false

Defined in src/components/common/mixins/combo-box.ts:120

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

Whether the component dropdown should be kept open on selection.

keepOpenOnSelect: boolean = false

Defined in src/components/common/mixins/combo-box.ts:108

The label of the datepicker.

label: string

Defined in src/components/date-picker/date-picker.ts:277

Determines whether the calendar is opened in a dropdown or a modal dialog

mode: PickerMode = 'dropdown'

Defined in src/components/date-picker/date-picker.ts:284

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

The name attribute of the control.

name: string

Defined in src/components/common/mixins/forms/types.ts:42

Whether to allow typing in the input.

nonEditable: boolean = false

Defined in src/components/date-picker/date-picker.ts:291

Sets the state of the datepicker dropdown.

open: boolean = false

Defined in src/components/date-picker/date-picker.ts:270

The orientation of the multiple months displayed in the calendar's days view.

orientation: ContentOrientation = 'horizontal'

Defined in src/components/date-picker/date-picker.ts:369

Whether the control will have outlined appearance.

outlined: boolean = false

Defined in src/components/date-picker/date-picker.ts:406

The placeholder attribute of the control.

placeholder: string

Defined in src/components/date-picker/date-picker.ts:413

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

prompt: string = '_'

Defined in src/components/date-picker/date-picker.ts:461

Makes the control a readonly field.

readOnly: boolean = false

Defined in src/components/date-picker/date-picker.ts:298

Whether to show the number of the week in the calendar.

showWeekNumbers: boolean = false

Defined in src/components/date-picker/date-picker.ts:427

Gets/sets special dates.

specialDates: DateRangeDescriptor[]

Defined in src/components/date-picker/date-picker.ts:399

The number of months displayed in the calendar.

visibleMonths: number = 1

Defined in src/components/date-picker/date-picker.ts:420

Sets the start day of the week for the calendar.

weekStart: WeekDays = 'sunday'

Defined in src/components/date-picker/date-picker.ts:493

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

MDN Reference

tagName: "igc-date-picker" = 'igc-date-picker'

Defined in src/components/date-picker/date-picker.ts:184

get activeDate(): Date

Defined in src/components/date-picker/date-picker.ts:323

Returns Date

Gets/Sets the date which is shown in the calendar picker and is highlighted. By default it is the current date.

set activeDate(value: string | Date | null | undefined): void

Defined in src/components/date-picker/date-picker.ts:319

Parameters

  • value: string | Date | null | undefined

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

get defaultValue(): unknown

Defined in src/components/common/mixins/forms/types.ts:163

Returns unknown

The initial value of the component.

set defaultValue(value: unknown): void

Defined in src/components/common/mixins/forms/types.ts:162

Parameters

  • value: unknown

Returns void

Gets/sets disabled dates.

set disabledDates(dates: DateRangeDescriptor[]): void

Defined in src/components/date-picker/date-picker.ts:387

Parameters

Returns void

get displayFormat(): string

Defined in src/components/date-picker/date-picker.ts:439

Returns string

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

set displayFormat(value: string): void

Defined in src/components/date-picker/date-picker.ts:435

Parameters

  • value: string

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

Returns the HTMLFormElement associated with this element.

get form(): HTMLFormElement | null

Defined in src/components/common/mixins/forms/types.ts:45

Returns HTMLFormElement | null

get inputFormat(): string

Defined in src/components/date-picker/date-picker.ts:453

Returns string

The date format to apply on the input. Defaults to the current locale Intl.DateTimeFormat

set inputFormat(value: string): void

Defined in src/components/date-picker/date-picker.ts:449

Parameters

  • value: string

Returns void

get locale(): string

Defined in src/components/date-picker/date-picker.ts:472

Returns string

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

set locale(value: string): void

Defined in src/components/date-picker/date-picker.ts:468

Parameters

  • value: string

Returns void

get max(): Date | null

Defined in src/components/date-picker/date-picker.ts:353

Returns Date | null

The maximum value required for the date picker to remain valid.

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

Defined in src/components/date-picker/date-picker.ts:347

Parameters

  • value: string | Date | null | undefined

Returns void

get min(): Date | null

Defined in src/components/date-picker/date-picker.ts:338

Returns Date | null

The minimum value required for the date picker to remain valid.

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

Defined in src/components/date-picker/date-picker.ts:332

Parameters

  • value: string | Date | null | undefined

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

get required(): boolean

Defined in src/components/common/mixins/forms/types.ts:181

Returns boolean

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

set required(value: boolean): void

Defined in src/components/common/mixins/forms/types.ts:180

Parameters

  • value: boolean

Returns void

get resourceStrings(): IgcCalendarResourceStrings & IDatePickerResourceStrings & ICalendarResourceStrings

Defined in src/components/date-picker/date-picker.ts:486

Returns IgcCalendarResourceStrings & IDatePickerResourceStrings & ICalendarResourceStrings

The resource strings for localization.

set resourceStrings(value: IgcCalendarResourceStrings | DatePickerResourceStringsType): void

Defined in src/components/date-picker/date-picker.ts:480

Parameters

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

A string containing the validation message of this element.

get validationMessage(): string

Defined in src/components/common/mixins/forms/types.ts:54

Returns string

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

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

get validity(): ValidityState

Defined in src/components/common/mixins/forms/types.ts:51

Returns ValidityState

get value(): Date | null

Defined in src/components/date-picker/date-picker.ts:310

Returns Date | null

The value of the picker

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

Defined in src/components/date-picker/date-picker.ts:306

Parameters

  • value: string | Date | null | undefined

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.

get willValidate(): boolean

Defined in src/components/common/mixins/forms/types.ts:60

Returns boolean

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

addEventListener(type: K, listener: object, options: boolean | AddEventListenerOptions): void

Defined in src/components/common/mixins/event-emitter.ts:7

Parameters

  • type: K
  • listener: object
  • options: boolean | AddEventListenerOptions

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

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

checkValidity(): boolean

Defined in src/components/common/mixins/forms/types.ts:146

Returns boolean

Clears the input part of the component of any user input

clear(): void

Defined in src/components/date-picker/date-picker.ts:650

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

Hides the component.

hide(): Promise<boolean>

Defined in src/components/common/mixins/combo-box.ts:90

Returns Promise<boolean>

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

removeEventListener(type: K, listener: object, options: boolean | EventListenerOptions): void

Defined in src/components/common/mixins/event-emitter.ts:17

Parameters

  • type: K
  • listener: object
  • options: boolean | EventListenerOptions

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

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

reportValidity(): boolean

Defined in src/components/common/mixins/forms/types.ts:149

Returns boolean

Selects the text in the input of the component

select(): void

Defined in src/components/date-picker/date-picker.ts:667

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

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

setCustomValidity(message: string): void

Defined in src/components/common/mixins/forms/types.ts:155

Parameters

  • message: string

Returns void

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

Defined in src/components/date-picker/date-picker.ts:683

Parameters

Returns void

Sets the text selection range in the input of the component

setSelectionRange(start: number, end: number, direction: SelectionRangeDirection): void

Defined in src/components/date-picker/date-picker.ts:673

Parameters

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

Shows the component.

show(): Promise<boolean>

Defined in src/components/common/mixins/combo-box.ts:85

Returns Promise<boolean>

Decrements the passed in date part

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

Defined in src/components/date-picker/date-picker.ts:662

Parameters

Returns void

Increments the passed in date part

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

Defined in src/components/date-picker/date-picker.ts:657

Parameters

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDatePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )

Toggles the open state of the component.

toggle(): Promise<boolean>

Defined in src/components/common/mixins/combo-box.ts:95

Returns Promise<boolean>

register(): void

Defined in src/components/date-picker/date-picker.ts:188

Returns void

igcChange: CustomEvent<Date | null>

Defined in src/components/date-picker/date-picker.ts:71

igcClosed: CustomEvent<void>

Defined in src/components/date-picker/date-picker.ts:70

igcClosing: CustomEvent<void>

Defined in src/components/date-picker/date-picker.ts:69

igcInput: CustomEvent<Date | null>

Defined in src/components/date-picker/date-picker.ts:72

igcOpened: CustomEvent<void>

Defined in src/components/date-picker/date-picker.ts:68

igcOpening: CustomEvent<void>

Defined in src/components/date-picker/date-picker.ts:67