iamkun / iamkun/dayjs

Feature Request - Calendar plugin texts should be part of locale

Open
#1,947 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Wrong/missing translation on calendar pluging to spanish language

**Expected behavior**
Parsing a date using UTC, adjusting it using timezone and translating using locale to "es" (spanish) i was expecting to translate a same date as "hoy a las" instead to "Today at"

As workaround i used the method below:
```
dayjs().calendar(null, {
sameDay: '[hoy a las] h:mm A', // The same day ( Today at 2:30 AM )
sameElse: 'DD/MM/YYYY' // Everything else ( 7/10/2011 )
})
```

**Information**
- Day.js Version: v1.11.3
- OS: Debian Sid / Debian 5.18.2-1 (2022-06-06)
- Browser: Firefox Developer Edition 102.0b7
- Time zone: GMT-04:00

Contributor guide

Open the contributing guide

Research direction

Start at the calendar plugin entry point and the Spanish (`es`) locale data, then trace how calendar phrases are selected after timezone adjustment. Compare the current default text with locale handling and verify the expected Spanish output for the same-day case described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
localization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.