Add support alternative calendar relative years in date-picker

Open
#2,933 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, react

Research direction

Start with the relativeYearFrom documentation and the year-picklist.jsx logic linked in the issue. Trace how the current Gregorian year becomes the base, then determine how an explicit or locale-derived base should interact with that prop. Done means alternative calendars such as Thai Buddhist avoid the unnecessary 500-year range while the current default behavior remains intact.

Written by the indexing model from the issue text.

Description

stale

Currently, the date picker allows the user to set the range of years to display in the calendar. This is always relative to the current year in the Gregorian calendar (e.g. this year it is 2021). While this is fine for most instances, for alternative calendars like the Thai Buddhist calendar, the year is always +543 of the current year, so this year is 2564.

It is possible to pick from that year if the range is expanded, but it will always include 2021 as the base, which means, when the user is in th-TH locale, there will be over 500 possible year selections on the calendar, which may not be the best in terms of user experience.

Ideally, we can let the user choose the base year (default would be current year), or automatically base it off of the user's locale.

Dominant language
JavaScript
Stars
994
Forks
444
Avg merge
3d 23h
Merged PRs (30d)
44

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from salesforce/design-system-react

All issues in salesforce/design-system-react

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.