@ebay/skin/calendar
DS v1The calendar module offers readonly and interactive calendar capabilities.
Both types of calendar are structured as data tables; each column representing a day of the week.
Readonly Calendar
A readonly calendar has cells containing static text or hypertext.
The current date is conveyed using calendar__cell--current and clipped text.
NOTE: for the eagle-eyed BEM afionados, we are saying each span has an implicit class of calendar__cell.
Read-Only Calendar with Inactive Dates
Inactive/unavailable dates are conveyed using calendar__cell--disabled and offscreen text.
Read-Only Calendar with Date Range
Date ranges are conveyed using calendar__cell--selected, calendar__range, calendar__range--start, calendar__range-end and clipped text.
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
1 - inactive | 2 - inactive | 3 - inactive | 4 - inactive | 5 - inactive | ||
6 - inactive | 7 - inactive | 8 - inactive | 9 - inactive | 10 - inactive | 11 - inactive | 12 - inactive |
13 - inactive | 14 - today | 15 | 16 | 17 - start of range | 18 - in range | 19 - in range |
20 - in range | 21 - in range | 22 - in range | 23 - in range | 24 - in range | 25 - end of range | 26 |
27 | 28 | 29 | 30 | 31 |
Interactive Calendar
An interactive calendar uses toggle buttons to allow the input of single dates or date ranges.
NOTE: a fully functional and accessible interactive calendar requires JavaScript and is outside the scope of a CSS library such as eBay Skin. The examples below are NOT fully functional and serve to demonstrate the necessary HTML semantics and styling hooks only.
Interactive Calendar With Single Date Selection
A single date selection is conveyed using aria-pressed.
NOTE: in comparison to the readonly calendar, with buttons we can now leverage the disabled property and aria-current instead of clipped text.
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
Interactive Calendar With Date Range Selection
Date ranges are bookended by two buttons with the aria-pressed property. All buttons in between these dates leverage clipped text for assistive technology.
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
Calendar With Header Pagination
The calendar module allows an optional header section for pagination between months.
Multi-month Calendar with Header Pagination
Multiple instances of calendar__month can be rendered inside of the calendar__body.
July 2023
August 2023
September 2023
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 - today | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |