The igc-date-range-picker allows the user to select a range of dates.
- Element
-
igc-date-range-picker
- Slots
-
prefix— Renders content before the input (single input). -
prefix-start— Renders content before the start input (two inputs). -
prefix-end— Renders content before the end input (two inputs). -
suffix— Renders content after the input (single input). -
suffix-start— Renders content after the start input (single input). -
suffix-end— Renders content after the end input (single 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. -
clear-icon-start— Renders a clear icon template for the start input (two inputs). -
clear-icon-end— Renders a clear icon template for the end input (two inputs). -
calendar-icon— Renders the icon/content for the calendar picker. -
calendar-icon-start— Renders the icon/content for the calendar picker for the start input (two inputs). -
calendar-icon-end— Renders the icon/content for the calendar picker for the end input (two inputs). -
calendar-icon-open— Renders the icon/content for the picker in open state. -
calendar-icon-open-start— Renders the icon/content for the picker in open state for the start input (two inputs). -
calendar-icon-open-end— Renders the icon/content for the picker in open state for the end input (two inputs). -
actions— Renders content in the action part of the picker in open state. -
separator— Renders the separator element between the two inputs.
- CSS Parts
-
separator— The separator element between the two inputs. -
ranges— The wrapper that renders the custom and predefined ranges. -
label— The label wrapper that renders content above the target input. -
calendar-icon— The calendar icon wrapper for closed state (single input). -
calendar-icon-start— The calendar icon wrapper for closed state for the start input (two inputs). -
calendar-icon-end— The calendar icon wrapper for closed state for the end input (two inputs). -
calendar-icon-open— The calendar icon wrapper for opened state (single input). -
calendar-icon-open-start— The calendar icon wrapper for opened state for the start input (two inputs). -
calendar-icon-open-end— The calendar icon wrapper for opened state for the end input (two inputs). -
clear-icon— The clear icon wrapper (single input). -
clear-icon-start— The clear icon wrapper for the start input (two inputs). -
clear-icon-end— The clear icon wrapper for the end input (two inputs). -
actions— The wrapper for the custom actions area. -
clear-icon— The clear icon wrapper. -
input— The native input element. -
prefix— The prefix wrapper. -
suffix— The suffix 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.
Constructors
Section titled "Constructors"IgcDateRangePickerComponent
new IgcDateRangePickerComponent(): IgcDateRangePickerComponent Defined in src/components/date-range-picker/date-range-picker.ts:625
Returns IgcDateRangePickerComponent
Properties
Section titled "Properties"customRanges
Section titled "customRanges"Renders chips with custom ranges based on the elements of the array.
customRanges: CustomDateRange[] = [] Defined in src/components/date-range-picker/date-range-picker.ts:338
disabled
Section titled "disabled"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDateRangePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
The disabled state of the component.
disabled: boolean emitEvent
Section titled "emitEvent"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDateRangePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
emitEvent: object & object Defined in src/components/common/mixins/event-emitter.ts:30, src/components/common/mixins/combo-box.ts:16
headerOrientation
Section titled "headerOrientation"The orientation of the calendar header.
headerOrientation: ContentOrientation = 'horizontal' Defined in src/components/date-range-picker/date-range-picker.ts:570
hideHeader
Section titled "hideHeader"Determines whether the calendar hides its header.
hideHeader: boolean = false Defined in src/components/date-range-picker/date-range-picker.ts:584
hideOutsideDays
Section titled "hideOutsideDays"Controls the visibility of the dates that do not belong to the current month.
hideOutsideDays: boolean = false Defined in src/components/date-range-picker/date-range-picker.ts:611
invalid
Section titled "invalid"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDateRangePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
Sets the control into invalid state (visual state only).
invalid: boolean keepOpenOnOutsideClick
Section titled "keepOpenOnOutsideClick"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDateRangePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
Whether the component dropdown should be kept open on clicking outside of it.
keepOpenOnOutsideClick: boolean = false keepOpenOnSelect
Section titled "keepOpenOnSelect"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDateRangePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
Whether the component dropdown should be kept open on selection.
keepOpenOnSelect: boolean = false label
Section titled "label"The label of the control (single input).
label: string Defined in src/components/date-range-picker/date-range-picker.ts:423
labelEnd
Section titled "labelEnd"The label attribute of the end input.
labelEnd: string = '' Defined in src/components/date-range-picker/date-range-picker.ts:437
labelStart
Section titled "labelStart"The label attribute of the start input.
labelStart: string = '' Defined in src/components/date-range-picker/date-range-picker.ts:430
Determines whether the calendar is opened in a dropdown or a modal dialog
mode: PickerMode = 'dropdown' Defined in src/components/date-range-picker/date-range-picker.ts:345
Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDateRangePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
The name attribute of the control.
name: string nonEditable
Section titled "nonEditable"Whether to allow typing in the input.
nonEditable: boolean = false Defined in src/components/date-range-picker/date-range-picker.ts:409
Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcDateRangePickerComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
Sets the open state of the component.
open: boolean = false Defined in src/components/common/mixins/combo-box.ts:32
orientation
Section titled "orientation"The orientation of the multiple months displayed in the calendar's days view.
orientation: ContentOrientation = 'horizontal' Defined in src/components/date-range-picker/date-range-picker.ts:577
outlined
Section titled "outlined"Whether the control will have outlined appearance.
outlined: boolean = false Defined in src/components/date-range-picker/date-range-picker.ts:416
placeholderEnd
Section titled "placeholderEnd"The placeholder attribute of the end input.
placeholderEnd: string = '' Defined in src/components/date-range-picker/date-range-picker.ts:465
placeholderStart
Section titled "placeholderStart"The placeholder attribute of the start input.
placeholderStart: string = '' Defined in src/components/date-range-picker/date-range-picker.ts:458
prompt
Section titled "prompt"The prompt symbol to use for unfilled parts of the mask.
prompt: string = '_' Defined in src/components/date-range-picker/date-range-picker.ts:471
readOnly
Section titled "readOnly"Makes the control a readonly field.
readOnly: boolean = false Defined in src/components/date-range-picker/date-range-picker.ts:402
showWeekNumbers
Section titled "showWeekNumbers"Whether to show the number of the week in the calendar.
showWeekNumbers: boolean = false Defined in src/components/date-range-picker/date-range-picker.ts:604
specialDates
Section titled "specialDates"Gets/sets special dates.
specialDates: DateRangeDescriptor[] Defined in src/components/date-range-picker/date-range-picker.ts:615
usePredefinedRanges
Section titled "usePredefinedRanges"Whether the control will show chips with predefined ranges.
usePredefinedRanges: boolean = false Defined in src/components/date-range-picker/date-range-picker.ts:363
useTwoInputs
Section titled "useTwoInputs"Use two inputs to display the date range values. Makes the input editable in dropdown mode.
useTwoInputs: boolean = false Defined in src/components/date-range-picker/date-range-picker.ts:352
weekStart
Section titled "weekStart"Sets the start day of the week for the calendar.
weekStart: WeekDays = 'sunday' Defined in src/components/date-range-picker/date-range-picker.ts:619
styles
Section titled "styles"styles: CSSResult[] Defined in src/components/date-range-picker/date-range-picker.ts:206
tagName
Section titled "tagName"The tagName read-only property of the Element interface returns the tag name of the element on which it's called.
tagName: "igc-date-range-picker" = 'igc-date-range-picker' Defined in src/components/date-range-picker/date-range-picker.ts:205
Accessors
Section titled "Accessors"activeDate
Section titled "activeDate"get activeDate(): Date Defined in src/components/date-range-picker/date-range-picker.ts:595
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-range-picker/date-range-picker.ts:591
Parameters
- value:
string | Date | null | undefined
Returns void
defaultValue
Section titled "defaultValue"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
disabledDates
Section titled "disabledDates"get disabledDates(): DateRangeDescriptor[] Defined in src/components/date-range-picker/date-range-picker.ts:545
Returns DateRangeDescriptor[]
Gets/sets disabled dates.
set disabledDates(dates: DateRangeDescriptor[]): void Defined in src/components/date-range-picker/date-range-picker.ts:539
Parameters
- dates:
DateRangeDescriptor[]
Returns void
displayFormat
Section titled "displayFormat"get displayFormat(): string Defined in src/components/date-range-picker/date-range-picker.ts:483
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-range-picker/date-range-picker.ts:479
Parameters
- value:
string
Returns void
Returns the HTMLFormElement associated with this element.
get form(): HTMLFormElement | null Defined in src/components/common/mixins/forms/types.ts:45
Returns HTMLFormElement | null
inputFormat
Section titled "inputFormat"get inputFormat(): string Defined in src/components/date-range-picker/date-range-picker.ts:499
Returns string
The date format to apply on the inputs. Defaults to the current locale Intl.DateTimeFormat
set inputFormat(value: string): void Defined in src/components/date-range-picker/date-range-picker.ts:495
Parameters
- value:
string
Returns void
locale
Section titled "locale"get locale(): string Defined in src/components/date-range-picker/date-range-picker.ts:374
Returns string
The locale settings used to display the value.
set locale(value: string): void Defined in src/components/date-range-picker/date-range-picker.ts:370
Parameters
- value:
string
Returns void
get max(): Date | null Defined in src/components/date-range-picker/date-range-picker.ts:533
Returns Date | null
The maximum value required for the date range picker to remain valid.
set max(value: string | Date | null | undefined): void Defined in src/components/date-range-picker/date-range-picker.ts:527
Parameters
- value:
string | Date | null | undefined
Returns void
get min(): Date | null Defined in src/components/date-range-picker/date-range-picker.ts:518
Returns Date | null
The minimum value required for the date range picker to remain valid.
set min(value: string | Date | null | undefined): void Defined in src/components/date-range-picker/date-range-picker.ts:512
Parameters
- value:
string | Date | null | undefined
Returns void
placeholder
Section titled "placeholder"get placeholder(): string Defined in src/components/date-range-picker/date-range-picker.ts:448
Returns string
The placeholder attribute of the control (single input).
set placeholder(value: string): void Defined in src/components/date-range-picker/date-range-picker.ts:444
Parameters
- value:
string
Returns void
required
Section titled "required"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
resourceStrings
Section titled "resourceStrings"get resourceStrings(): IgcDateRangePickerResourceStrings & IDateRangePickerResourceStrings & ICalendarResourceStrings Defined in src/components/date-range-picker/date-range-picker.ts:388
Returns IgcDateRangePickerResourceStrings & IDateRangePickerResourceStrings & ICalendarResourceStrings
The resource strings of the date range picker.
set resourceStrings(value: IgcDateRangePickerResourceStrings | DateRangePickerResourceStringsType): void Defined in src/components/date-range-picker/date-range-picker.ts:380
Parameters
- value:
IgcDateRangePickerResourceStrings | DateRangePickerResourceStringsType
Returns void
validationMessage
Section titled "validationMessage"A string containing the validation message of this element.
get validationMessage(): string Defined in src/components/common/mixins/forms/types.ts:54
Returns string
validity
Section titled "validity"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
value
Section titled "value"get value(): DateRangeValue | null Defined in src/components/date-range-picker/date-range-picker.ts:331
Returns DateRangeValue | null
The value of the picker
set value(value: string | DateRangeValue | null | undefined): void Defined in src/components/date-range-picker/date-range-picker.ts:326
Parameters
- value:
string | DateRangeValue | null | undefined
Returns void
visibleMonths
Section titled "visibleMonths"The number of months displayed in the calendar.
get visibleMonths(): number Defined in src/components/date-range-picker/date-range-picker.ts:558
Returns number
set visibleMonths(value: number): void Defined in src/components/date-range-picker/date-range-picker.ts:562
Parameters
- value:
number
Returns void
willValidate
Section titled "willValidate"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
Methods
Section titled "Methods"addEventListener
Section titled "addEventListener"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
checkValidity
Section titled "checkValidity"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
clear
Section titled "clear"Clears the input parts of the component of any user input
clear(): void Defined in src/components/date-range-picker/date-range-picker.ts:675
Returns void
hasDateParts
Section titled "hasDateParts"hasDateParts(): boolean Defined in src/components/date-range-picker/date-range-picker.ts:660
Returns boolean
hasTimeParts
Section titled "hasTimeParts"hasTimeParts(): boolean Defined in src/components/date-range-picker/date-range-picker.ts:668
Returns boolean
Hides the component.
hide(): Promise<boolean> Defined in src/components/common/mixins/combo-box.ts:90
Returns Promise<boolean>
removeEventListener
Section titled "removeEventListener"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
reportValidity
Section titled "reportValidity"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
select
Section titled "select"Selects a date range value in the picker
select(value: DateRangeValue | null): void Defined in src/components/date-range-picker/date-range-picker.ts:688
Parameters
- value:
DateRangeValue | null
Returns void
setCustomValidity
Section titled "setCustomValidity"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
Shows the component.
show(): Promise<boolean> Defined in src/components/common/mixins/combo-box.ts:85
Returns Promise<boolean>
toggle
Section titled "toggle"Toggles the open state of the component.
toggle(): Promise<boolean> Defined in src/components/common/mixins/combo-box.ts:95
Returns Promise<boolean>
register
Section titled "register"register(): void Defined in src/components/date-range-picker/date-range-picker.ts:209
Returns void
Events
Section titled "Events"igcChange
Section titled "igcChange"igcChange: CustomEvent<DateRangeValue | null> Defined in src/components/date-range-picker/date-range-picker.ts:90
igcClosed
Section titled "igcClosed"igcClosed: CustomEvent<void> Defined in src/components/date-range-picker/date-range-picker.ts:89
igcClosing
Section titled "igcClosing"igcClosing: CustomEvent<void> Defined in src/components/date-range-picker/date-range-picker.ts:88
igcInput
Section titled "igcInput"igcInput: CustomEvent<DateRangeValue | null> Defined in src/components/date-range-picker/date-range-picker.ts:91
igcOpened
Section titled "igcOpened"igcOpened: CustomEvent<void> Defined in src/components/date-range-picker/date-range-picker.ts:87
igcOpening
Section titled "igcOpening"igcOpening: CustomEvent<void> Defined in src/components/date-range-picker/date-range-picker.ts:86