iamkun / iamkun/dayjs

Feature: add locale format string to localeData or somewhere else

Open
#894 15 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

I want to set a datefields default format based on the language preference which is set on start but the only way to get the format string for the correct locale is seen below. I would like to have a valid function or constant that I can use. The right place for that would be in localeData or in `locale()` IMO but I don't even undestand why there are two `locale` and `$locale`?

```js
dayjs().$locale().formats.L
```

![Bildschirmfoto 2020-05-03 um 16 20 11](https://user-images.githubusercontent.com/11534760/80916636-46a4cd00-8d5a-11ea-8a31-cca63730ed01.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.