When to use
Section titled “When to use”- To choose a statement, invoice or report period.
- Wherever month and year are enough: card expiry, settlement period.
When not to use
Section titled “When not to use”- When the day matters too: use DatePicker.
- When only the year matters: use YearPicker.
- When there are few fixed options: use Select.
Anatomy
Section titled “Anatomy”- Label: the Field label.
- Trigger: a button that shows the value or the placeholder and a calendar icon.
- Header: The year, with the previous and next page buttons.
- Grid: twelve cells in three columns. The short month name; its accessible name is month and year.
Behaviour
Section titled “Behaviour”- The grid opens on the page of the chosen month, or the current one; focus is on the chosen or current cell.
- Arrow keys move to the previous or next page at the page edge.
- Choosing a cell closes the grid and returns focus to the trigger.
- Cells outside
minandmaxcannot be chosen.isMonthUnavailableblocks closed months inside the range. - With
name, a hidden input submits the value asYYYY-MM.
Guidelines
Section titled “Guidelines”- Limit the range with
minandmax, and state the range in the help text. - Do not use both DatePicker and MonthPicker for the same period in one form.
Content
Section titled “Content”- The label says what the period is for: “Statement period”, “Card expiry”.
- Month names are formatted with
Intlin the Provider language.
Related components
Section titled “Related components”- DatePicker: day, month and year.
- YearPicker: the year only.
- DateRangePicker: a date range.