Time format depending on the locale (bcp47)
Open
Nobody has claimed this yet.
discussion
question
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 463
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
How to display time in locale specific format (bcp47 language tag)?
const event=new Date();
const options={timeZone:'UTC',year:'numeric',month:'numeric',day:'numeric',hour:'numeric',minute:'numeric',second:'numeric'};
console.log(event.toLocaleDateString('ko-KR', options)); // → "2021. 3. 20. 오후 3:40:17"
console.log(event.toLocaleDateString('en-GB', options)); // → "20/03/2021, 15:40:17"
console.log(event.toLocaleDateString('en-US', options)); // → "3/20/2021, 3:40:17 PM"
console.log(event.toLocaleDateString('de-DE', options)); // → "20.3.2021, 15:40:17"
console.log(event.toLocaleDateString('ru-RU', options)); // → "20.03.2021, 15:40:17"
Thanks.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue provides locale-specific JavaScript Date formatting examples but names no uPlot files, tests, or entry points. Start by locating the chart's time-axis formatting behavior, then define the supported locale input and expected output before implementing and testing the proposed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100