Date picker - Code
Basic
Single Selection
Require confirmation
By default, date pickers apply every pick immediately.
Set requireConfirmation to only apply the selection when users click Confirm.
Cancel restores the last confirmed value.
Date pickers emit dateChange for every pick and dateSelect only when the selection should be applied: with Done or Confirm, or on pick in single selection without requireConfirmation.
Translation
The ix-date-picker can be configured using BCP 47 locale strings specifying the language to use generating or interpreting strings. More information can be found here
API for ix-date-picker
Properties
ARIA label for the next month icon button
Will be set as aria-label on the nested HTML button element
aria-label-month-selectionstring | undefined'Select month'ARIA label for the next month icon button.
Will be set as aria-label on the nested HTML button element.
aria-label-next-month-buttonstring | undefined'Change calendar view to next month'ARIA label for the previous month icon button.
Will be set as aria-label on the nested HTML button element.
aria-label-previous-month-buttonstring | undefined'Change calendar view to previous month'ARIA label for the next month icon button
Will be set as aria-label on the nested HTML button element
aria-label-year-selectionstring | undefined'Select year'Corner style.
corners"left" | "right" | "rounded" | "straight"'rounded'Enable Popover API rendering for dropdown.
enable-top-layerbooleanfalseDate format string.
See https://moment.github.io/luxon/#/formatting?id=table-of-tokens for all available tokens.
formatstring'yyyy/LL/dd'The selected starting date. If the date picker is not in range mode, this is the selected date.
Format has to match the format property.
fromstring | undefinedText of the cancel button shown when requireConfirmation is enabled.
i18n-cancelstring'Cancel'Text of the confirm button shown when requireConfirmation is enabled.
i18n-confirmstring'Confirm'Text of the date select button.
i18n-donestring'Done'Locale identifier (e.g. 'en' or 'de').
The locale is used to translate the labels for weekdays and months.
When the locale changes, the weekday labels are rotated according to the weekStartIndex.
The locale is also applied when formatting and parsing date values.
For locale-dependent format tokens (e.g. MMMM, MMM), the output will reflect the locale.
Use the isoFrom and isoTo fields on events for locale-independent values.
localestring | undefinedThe latest date that can be selected by the date picker.
If not set there will be no restriction.
max-datestring''The earliest date that can be selected by the date picker.
If not set there will be no restriction.
min-datestring''If true, a selection is only applied after the user confirms it with the
confirm button, which emits dateSelect. dateChange still reports
every pick. The cancel button discards the
pending selection.
require-confirmationbooleanfalseShows week numbers displayed on the left side of the date picker.
show-week-numbersbooleanfalseIf true, disables date range selection (from/to).
single-selectionbooleanfalseThe selected end date. If the date picker is not in range mode, this property has no impact.
Format has to match the format property.
tostring | undefinedThe index of the day the week starts on, as a 0-based index into Luxon's
Info.weekdays() array. That array is always ordered Monday-first
regardless of locale, so 0 is Monday, 1 is Tuesday and 6 is Sunday.
E.g. weekStartIndex = 6 results in starting the week on Sunday.
week-start-indexnumber0Methods
Events
Emitted when the pending selection is discarded via the cancel button.
dateCancelvoidEmitted on any date selection change. The DateChangeEvent contains from and to properties
formatted according to the format and locale properties.
Use isoFrom and isoTo for locale-independent ISO 8601 date strings.
Note: Since 2.0.0 dateChange does not dispatch detail property as string
When a pending selection is discarded, it is emitted with the confirmed
selection again. Use dateSelect to receive only the applied selection.
dateChangeDateRange<string> & { isoFrom?: string | undefined; isoTo?: string | undefined; }Date range change event. Emitted when the date range selection changes and the component is in range mode.
The DateChangeEvent contains from and to properties formatted according to the format and locale properties.
Use isoFrom and isoTo for locale-independent ISO 8601 date strings.
Emitted together with dateChange.
dateRangeChangeDateRange<string> & { isoFrom?: string | undefined; isoTo?: string | undefined; }Date selection event. Emitted when the selection is applied via the done
button, or via the confirm button with requireConfirmation. With
singleSelection and without requireConfirmation there is no button,
so it is emitted together with dateChange when a date is picked.
The DateChangeEvent contains from and to properties formatted according to the format and locale properties.
Use isoFrom and isoTo for locale-independent ISO 8601 date strings.
dateSelectDateRange<string> & { isoFrom?: string | undefined; isoTo?: string | undefined; }