Date dropdown
Examples
Basic
With user defined range options
API
Properties
Name
Description and specifications
customRangeAllowed
Controls whether the user is allowed to pick custom date ranges in the component.
When set to 'true', the user can select a custom date range using the date picker.
When set to 'false', only predefined time date ranges are available for selection.
Attribute:
custom-range-allowedType:
booleanDefault:
truedateRangeId
Used to set the initial select date range as well as the button name,
if not set or no according date range label is found, nothing will be selected
Attribute:
date-range-idType:
stringDefault:
'custom'dateRangeOptions
An array of predefined date range options for the date picker.
Each option is an object with a label describing the range and a function
that returns the start and end dates of the range as a DateRangeOption object.
Example format:
{
id: 'some unique id',
label: 'Name of the range',
from: undefined, to: '2023/03/29'
},
// ... other predefined date range options ...
Type:
DateDropdownOption[]Default:
[]disabled
Since 2.3.0
Disable the button that opens the dropdown containing the date picker.
Attribute:
disabledType:
booleanDefault:
falseformat
Date format string.
See
Attribute:
formatType:
stringDefault:
'yyyy/LL/dd'from
Picker date. If the picker is in range mode this property is the start date.
If set to `null` no default start date will be pre-selected.
Format is based on `format`
Attribute:
fromType:
stringDefault:
''ghost
Button with no background or outline
Attribute:
ghostType:
booleanDefault:
falsei18nCustomItem
Text for custom dropdown item. Will be used for translation.
Attribute:
i18n-custom-itemType:
stringDefault:
'Custom...'i18nDone
Text for the done button. Will be used for translation.
Attribute:
i18n-doneType:
stringDefault:
'Done'i18nNoRange
Text for the done button. Will be used for translation.
Attribute:
i18n-no-rangeType:
stringDefault:
'No range set'loading
Loading button
Attribute:
loadingType:
booleanDefault:
falselocale
Since 2.6.0
Locale identifier (e.g. 'en' or 'de').
Attribute:
localeType:
string | undefinedmaxDate
The latest date that can be selected by the date picker.
If not set there will be no restriction.
Attribute:
max-dateType:
stringDefault:
''minDate
The earliest date that can be selected by the date picker.
If not set there will be no restriction.
Attribute:
min-dateType:
stringDefault:
''outline
Outline button
Attribute:
outlineType:
booleanDefault:
falserange
If true a range of dates can be selected.
Attribute:
rangeType:
booleanDefault:
trueto
Picker date. If the picker is in range mode this property is the end date.
If the picker is not in range mode leave this value `null`
Format is based on `format`
Attribute:
toType:
stringDefault:
''variant
Button variant
Attribute:
variantType:
"danger" | "primary" | "secondary"Default:
'primary'weekStartIndex
Since 2.6.0
The index of which day to start the week on, based on the Locale#weekdays array.
E.g. if the locale is en-us, weekStartIndex = 1 results in starting the week on monday.
Attribute:
week-start-indexType:
numberDefault:
0Events
Name
Description and specifications
dateRangeChange
EventEmitter for date range change events.
This event is emitted when the date range changes within the component.
The event payload contains information about the selected date range.
Detail:
{ id: string; from: string; to: string; }