Q2 Calendar
- Updated:
Provides an input field that triggers a popover date picker.
Documentation
Attributes API
The q2-calendar
element has several properties that support text localization. Those properties are indicated by the localizable badge below.
Property | Attribute | Type | Default | Description |
---|---|---|---|---|
assume | assume | string |
| Use Type
Example Always assume the current year:
Assume the next year if the type mm/dd is later than today:
Assume the previous year if the type mm/dd is earlier than today:
|
calendarLabel | calendar-label | string |
| A label shown at the top of the popover date picker. Example
|
cutoffTime | cutoff-time | string |
| Specifies a time of day after which a date is no longer valid. Must be a valid ISO date string. Example
|
daysOfWeekChecksum | days-of-week-checksum | number |
|
Sum the checksum values of your desired valid days, and set Example
|
disabled | disabled | boolean | false | When Example
|
disabledMsg | disabled-msg | string |
| Text that appears within the Example
|
disclaimer | disclaimer | string |
| Text that appears at the bottom of the popover date picker. Example
|
displayFormat | display-format | string |
| Determines the display format of the date field value. Must follow the date-fns token specification. Example
|
endDate | end-date | string |
| Defines the last selectable date in the date picker popover. Must be a valid ISO date string. Example
|
hideLabel | hide-label | boolean | false | Hides the field's Only use when a visible label is impractical. Example
|
invalid | invalid | boolean | false | This property is used to show error styles when the calendar is in an errant state. Example
|
invalidDates |
| array |
| Defines an explicit date blacklist. Each entry must be a valid ISO date string. When explicit date definition like invalidDates is used, other date validity methods like daysOfWeekChecksum are overridden. Example
|
label | label | string |
| The visible label for the Example
|
optional | optional | boolean | true | When Example
|
popDirection | pop-direction | string |
| Use Type
Example
|
startDate | start-date | string |
| Defines the first selectable date in the date picker popover. Must be a valid ISO date string. Example
|
typeable | typeable | boolean | false | When Example
|
validDates |
| array |
| Defines a date whitelist. Each entry must be a valid ISO date string. When explicit date definition like validDates is used, other date validitity methods like daysOfWeekChecksum are overridden. Example
|
value | value | string |
| The value of the Example
How to change or clear value using javascript
|
Events API
The q2-calendar
element exposes events that can be used to send and receive data from the component.
Event | Details |
---|---|
change | Emitted when a date is selected. Type
Example
|
The lists below contain references to all the CSS variables available for use in the q2-calendar
component.
The following CSS variables are available to override the default theme styles of the q2-calendar
component.
The following CSS variables are used by the q2-calendar
component and available for theming.