Found 6 locales that throw when doing relative date
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
These 6 locales throw when running relative date:
`ar-ly (Arabic (Lybia))`
`de-ch (German (Switzerland))`
`it-ch (Italian (Switzerland))`
`lv (Latvian)`
`mr (Marathi)`
`sl (Slovenian)`
(There could be more)
**Expected behavior**
The following code shouldn't throw
```js
dayjs().locale('de').add(3, 'day').fromNow(); // ok
dayjs().locale('de-ch').add(3, 'day').fromNow(); // throws
dayjs().locale('it').add(3, 'day').fromNow(); // ok
dayjs().locale('it-ch').add(3, 'day').fromNow(); // throws
dayjs().locale('ar').add(3, 'day').fromNow(); // ok
dayjs().locale('ar-ly').add(3, 'day').fromNow(); // throws
dayjs().locale('lv').add(3, 'day').fromNow(); // throws
dayjs().locale('mr').add(3, 'day').fromNow(); // throws
dayjs().locale('sl').add(3, 'day').fromNow(); // throws
```
**Information**
- Day.js Version: v1.8.23
- OS: Win10
- Browser: Chrome80
- Time zone: Any Time Zone
Contributor guide
Research direction
Start with the provided JavaScript reproductions using locale().add(3, 'day').fromNow() for ar-ly, de-ch, it-ch, lv, mr, and sl. Inspect the relative-date handling for these locales and verify that the examples no longer throw, including checking whether additional locales show the same failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- localization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100