salesforce / salesforce/design-system-react

Add support alternative calendar relative years in date-picker

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

Nobody has claimed this yet.

stale
Dominant language
JavaScript
Stars
982
Forks
440
Avg merge
1d 21h
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.