Open nmanumr opened 1 year ago
Thank you for your interest and contribution offer! Looking at the our internal Spectrum Design site, I'm not seeing any designs defining how we'd like these week/year/decade view to look or behave, so we'll have to bring this up with the design team first.
btw you can already build a week view with the hooks by setting the visibleDuration
option. There's an example linked from the docs.
@devongovett Exactly we don't need to change anything for the week view in the hooks but for the Calendar component from react-aria-components
to work for the week view I guess we need to change a few things here. Meanwhile I can fix this if you want.
Closely related to this discussion
๐ Feature Request
Currently, the Adobe Spectrum React calendar component only supports a single view, which is the month view. This feature request proposes adding additional views to the calendar component, including year, decade, and week views.
๐ค Expected Behavior
There can a view prop which can be used to change the view of the calendar for example
๐ฏ Current Behavior
Currently calendar component only supports the month view.
๐ Possible Solution
I already implemented this feature internally for my team (detail in context section), and here's how I did it:
useCalendarState
anduseRangeCalendarState
Although the current implementation is quite cranky, I'm willing to contribute to this feature. Just let me know If what I did aligns with adobe spectrum design's philosophy.
๐ฆ Context
I had been working on a date picker component. The current implementation of the date picker component does not have a year or decade view. This means that users have to click through many months to select a date that is a few years from the past.
To fix this issue, I internally patched the current implementation of the calendar component for my team to add support for month, year, and week views. This allows users to select dates more easily, regardless of how far in the past or future they are.
For this, I had to patch:
@react-stately/useCalendarState
@react-stately/useRangeCalendarState
@react-aria/useCalendar
@react-aria/useRangeCalendar
@react-aria/useCalendarCell
@react-aria/useCalendarGrid
react-aria-components
.๐ป Examples
These are the screenshots of my implementation.
๐งข Your Company/Team
CarteBlanche.tech / Hirecinch