question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature: add locale format string to localeData or somewhere else

See original GitHub issue

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?

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

Bildschirmfoto 2020-05-03 um 16 20 11

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
iamkuncommented, May 7, 2020

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.

0reactions
muuvmuuvcommented, Jul 27, 2020

Ofc, it is just my opinion. At the end you have to decide.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found