How to create React Aria DatePicker with Year or Decade view

878 Views Asked by At

I'm building a React-Aria DatePicker but I haven't been able to find a way of creating a year or decade view. That is, where is shows the 12 months of the year and allows me to toggle the previous and next buttons on a year by year basis, or where it shows decades, and allows me to toggle left or right per decade. Does anyone know if this is possible and can point me towards any examples?

1

There are 1 best solutions below

0
On

In case anyone ever finds this useful. I created a GitHub thread in React-Aria where I was able to work out a solution:

Link to thread: https://github.com/adobe/react-spectrum/discussions/3950#discussioncomment-4835337

Link to codepen: https://codesandbox.io/s/xenodochial-curie-9k38nz?file=/src/DatePicker.js