react-spectrum
3f7c5116 - feat: custom calendar support (#7803)

Commit
227 days ago
feat: custom calendar support (#7803) * Add createCalendar prop to Calendar/RangeCalendar * Update date math for adding/subtracting months * Add doc comments * Simplify isEqualDay/Month/Year * Display the calendar month name based on the result of getCurrentMonth() * Format aria labels based on current month * Refactor to return weeksInMonth from useCalendarGrid hook * Fix month's year display in calendar header for custom calendars * Update Calendar and RangeCalendar docs to talk about custom calendars * Add custom calendar stories to Calendar and RangeCalendar * Fix range selection styles for custom calendar * Write tests for custom calendar date math * Write tests for changes to queries.ts * Use customCalendarImpl in stories * Write tests for visible range description with custom calendar * Update calendar docs to use jsx syntax * Update calendar docs to fully implement Calendar interface to satisfy the type checker * Update calendar docs Finally learned how to run `make check-examples` myself * wip * fix * feat: use suggestion from @devongovett to implement custom cal w/ julian dates * chore: remove unnecessary code in queries & manipulation * feat: zero-index the week pattern in 454 calendar impl * chore: remove unused code in utils * test: update useCalendar tests for custom calendar * test: verify conversion for end of big year * feat: update createCalendar prop types * feat: add createCalendar prop to DatePicker and DateRangePicker * Update docs * update examples * ts * docs: update docs for DatePicker and DateRangePicker * docs: remove custom calendar system section in useCalendar hooks * chore: more code cleanup * fix: mdx example * Add isEqualCalendar function * Update docs --------- Co-authored-by: Devon Govett <devongovett@gmail.com>
Author
Parents
Loading