Feature: add locale format string to localeData or somewhere else
See original GitHub issueI 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?
dayjs().$locale().formats.L

Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Get Locale Short Date Format using javascript - Stack Overflow
I tried to cook a little something to try and do that (only tested on Firefox with one locale). should work as long...
Read more >The Elegant and Fast Way (The GNU C Library)
This return value can be used as a format string for strftime to represent dates and times in a locale-specific era-based way. ERA_D_FMT...
Read more >Date.prototype.toLocaleDateString() - JavaScript | MDN
A string representing the date portion of the given Date instance according to language-specific conventions. In implementations with Intl.
Read more >10Localizing Strings and Locale Data - Oracle Help Center
... from one of several translations for a set of symbolic string locale records. ... For example, this feature can be useful in...
Read more >Date and time localization - Lokalise Blog
In order to convert UTC to local time, we need to add the time offset ... string as input and then the parse...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ll check momentjs to see if there is a better API name or method. dayjs.Ls is too tricky to list on the doc.
Ofc, it is just my opinion. At the end you have to decide.