Represents a calendar that lets users to select a date value in a variety of different ways.

Element
igc-calendar
Slots
default — The default slot for the calendar.
title — Renders the title of the calendar header.
header-date — Renders content instead of the current date/range in the calendar header.
CSS Parts
header — The header element of the calendar.
header-title — The header title element of the calendar.
header-date — The header date element of the calendar.
content — The content element which contains the views and navigation elements of the calendar.
content-vertical — The content element which contains the views and navigation elements of the calendar in vertical orientation.
navigation — The navigation container element of the calendar.
months-navigation — The months navigation button element of the calendar.
years-navigation — The years navigation button element of the calendar.
years-range — The years range element of the calendar.
navigation-buttons — The navigation buttons container of the calendar.
navigation-button — Previous/next navigation button of the calendar.
days-view-container — The days view container element of the calendar.
days-view — Days view element of the calendar.
months-view — The months view element of the calendar.
years-view — The years view element of the calendar.
days-row — Days row element of the calendar.
label — Week header label element of the calendar.
week-number — Week number element of the calendar.
week-number-inner — Week number inner element of the calendar.
date — Date element of the calendar.
date-inner — Date inner element of the calendar.
first — The first selected date element of the calendar in range selection.
last — The last selected date element of the calendar in range selection.
inactive — Inactive date element of the calendar.
hidden — Hidden date element of the calendar.
weekend — Weekend date element of the calendar.
range — Range selected element of the calendar.
special — Special date element of the calendar.
disabled — Disabled date element of the calendar.
single — Single selected date element of the calendar.
preview — Range selection preview date element of the calendar.
month — Month element of the calendar.
month-inner — Month inner element of the calendar.
year — Year element of the calendar.
year-inner — Year inner element of the calendar.
selected — Indicates selected state. Applies to date, month and year elements of the calendar.
current — Indicates current state. Applies to date, month and year elements of the calendar.

IgcCalendarComponent

new IgcCalendarComponent(): IgcCalendarComponent

Defined in src/components/calendar/calendar.ts:249

Returns IgcCalendarComponent

The current active view of the component.

activeView: CalendarActiveView = 'days'

Defined in src/components/calendar/calendar.ts:238

The options used to format the months and the weekdays in the calendar views.

formatOptions: Pick<Intl.DateTimeFormatOptions, "month" | "weekday">

Defined in src/components/calendar/calendar.ts:242

The orientation of the calendar header.

headerOrientation: CalendarHeaderOrientation = 'horizontal'

Defined in src/components/calendar/calendar.ts:213

Whether to render the calendar header part. When the calendar selection is set to multiple the header is always hidden.

hideHeader: boolean = false

Defined in src/components/calendar/calendar.ts:205

Whether to show the dates that do not belong to the current active month.

hideOutsideDays: boolean = false

Defined in src/components/calendar/calendar.ts:195

The orientation of the calendar months when more than one month is being shown.

orientation: ContentOrientation = 'horizontal'

Defined in src/components/calendar/calendar.ts:222

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

Sets the type of selection in the component.

selection: CalendarSelection = 'single'

Defined in src/components/calendar/base.ts:124

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

Whether to show the week numbers.

showWeekNumbers: boolean = false

Defined in src/components/calendar/base.ts:132

The number of months displayed in the days view.

visibleMonths: number = 1

Defined in src/components/calendar/calendar.ts:230

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

Gets/Sets the first day of the week.

weekStart: WeekDays = 'sunday'

Defined in src/components/calendar/base.ts:140

styles: CSSResult = styles

Defined in src/components/calendar/calendar.ts:112

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-calendar" = 'igc-calendar'

Defined in src/components/calendar/calendar.ts:111

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

get activeDate(): Date

Defined in src/components/calendar/base.ts:114

Returns Date

Get/Set the date which is shown in view and is highlighted. By default it is the current date.

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

Defined in src/components/calendar/base.ts:106

Parameters

  • value: string | Date | null | undefined

Returns void

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

get disabledDates(): DateRangeDescriptor[] | undefined

Defined in src/components/calendar/base.ts:186

Returns DateRangeDescriptor[] | undefined

Gets/Sets the disabled dates for the component.

set disabledDates(value: DateRangeDescriptor[]): void

Defined in src/components/calendar/base.ts:182

Parameters

Returns void

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

get locale(): string

Defined in src/components/calendar/base.ts:151

Returns string

Gets/Sets the locale used for formatting and displaying the dates in the component.

set locale(value: string): void

Defined in src/components/calendar/base.ts:147

Parameters

  • value: string

Returns void

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

get resourceStrings(): IgcCalendarResourceStrings & ICalendarResourceStrings

Defined in src/components/calendar/base.ts:165

Returns IgcCalendarResourceStrings & ICalendarResourceStrings

The resource strings for localization.

set resourceStrings(value: IgcCalendarResourceStrings | ICalendarResourceStrings): void

Defined in src/components/calendar/base.ts:159

Parameters

Returns void

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

get specialDates(): DateRangeDescriptor[] | undefined

Defined in src/components/calendar/base.ts:176

Returns DateRangeDescriptor[] | undefined

Gets/Sets the special dates for the component.

set specialDates(value: DateRangeDescriptor[]): void

Defined in src/components/calendar/base.ts:172

Parameters

Returns void

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

get value(): Date | null

Defined in src/components/calendar/base.ts:82

Returns Date | null

The current value of the calendar. Used when selection is set to single

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

Defined in src/components/calendar/base.ts:77

Parameters

  • value: string | Date | null | undefined

Returns void

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

get values(): Date[]

Defined in src/components/calendar/base.ts:99

Returns Date[]

The current values of the calendar. Used when selection is set to multiple of range.

set values(values: string | string | Date[] | null | undefined): void

Defined in src/components/calendar/base.ts:94

Parameters

  • values: string | string | Date[] | null | undefined

Returns void

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

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: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

emitEvent(type: K, eventInitDict: CustomEventInit<D>): boolean

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

Parameters

  • type: K
  • eventInitDict: CustomEventInit<D>

Returns boolean

Inherited from: EventEmitterMixin< IgcCalendarComponentEventMap, Constructor<IgcCalendarBaseComponent> >(IgcCalendarBaseComponent)

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

register(): void

Defined in src/components/calendar/calendar.ts:115

Returns void

igcChange: CustomEvent<Date | Date[]>

Defined in src/components/calendar/types.ts:29