DocsDocs

MonthPicker

A field that opens a year of months to choose a month.

BetaSince 1.0.0
On this page

Overview

Show code, ReportMonth.tsx

Anatomy

  1. Field

  2. Control

  3. Label

  4. Value

  5. Clear

  6. Calendar icon

  7. Description

Show code, MonthPickerAnatomy.tsx
  1. Popup

  2. Previous year

  3. Year

  4. Next year

  5. Month

  6. Actions

Show code, MonthPickerPopupAnatomy.tsx

Behaviour

Choosing a month

The month shows in the reader's language, and choosing one closes the popup.

Within a fiscal year

Months outside the range a field allows are unavailable, and the year buttons stop at them.

Show code, FiscalYear.tsx

A short format

The field can write the month in a shorter form, such as 07/28.

Show code, ShortFormat.tsx

Rules

A month picker is for a month where the day doesn't matter, one month to a field.

Use it when

  • A month of a year, such as the month a report covers

Ranges

Use two fields for a range of months, such as From and To.

Accessibility

KeyAction
Enter, Space, ↓, ↑ on the fieldOpens the popup at the chosen value.
Arrow keysMove between months.
Page Up, Page DownMoves a year.
Enter, Space on a monthChooses the month.
EscCloses the popup and returns focus to the field.
Backspace, Delete on the fieldClears a clearable field.