react-spectrum
react-spectrum copied to clipboard
Granularity type missing month and year
Provide a general summary of the issue here
Hi there,
I need to display the date in the DateField component in the following format mm/yyyy or just the year. In the docs I saw that you should be supposed to do that by passing 'month'/'year' to the granularity prop but I can see that it is accepting currently 'hour' | 'minute' | 'second' | 'day'.
🤔 Expected Behavior?
Being able to pass month and year to the granularity prop in the DateField component.
😯 Current Behavior
Not being able to pass month and year to the granularity prop in the DateField component.
💁 Possible Solution
Potentially just extending the Granularity type to include month and year
🔦 Context
No response
🖥️ Steps to Reproduce
Following the Granularity example in this page https://react-spectrum.adobe.com/react-aria/DateField.html#granularity, try passing 'month'/'year'
Version
3.44
What browsers are you seeing the problem on?
Other, Firefox
If other, please specify.
No response
What operating system are you using?
MacOs
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response