Why does locale/en.js not have `formats`?
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
The `en` locale does not have `formats` and similar properties required by the `localeData` plugin - unlike other locales.
This breaks the `dayjs.localeData().longDateFormat` method, which [expects the loaded locale to have a `formats` property](https://github.com/iamkun/dayjs/blob/dev/src/plugin/localeData/index.js#L17)
Wouldn't it make sense to add [these formats](https://github.com/iamkun/dayjs/blob/8a0811226679a6128714a0ed188f2d0ef0254313/src/plugin/localizedFormat/utils.js#L5) to `en.js`?
Contributor guide
Research direction
Start with locale/en.js and inspect how src/plugin/localeData/index.js reads the locale's formats property. Compare the expected values with the formats referenced in src/plugin/localizedFormat/utils.js. Done means the en locale supplies the required formats and localeData().longDateFormat works without the reported breakage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- internationalization
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100