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.

How to get the locale format?

See original GitHub issue

What is the equivalent of this moment code?

moment.localeData().longDateFormat('L')

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
iamkuncommented, Nov 15, 2019

Added in #734, and will be available in the next release.

Usage:

var dayjs = require("dayjs")
var LocalizedFormat = require( 'dayjs/plugin/localizedFormat')
var localeData = require( 'dayjs/plugin/localeData')

dayjs.extend(LocalizedFormat)
dayjs.extend(localeData)

console.log(dayjs().localeData().longDateFormat('L'))
0reactions
xrzhuangcommented, Jun 4, 2021

how do I test that this works? I want to observe localeData() on various different formats. For example it appears to work on my browser, but I want to view the result for other locales like de

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get locale format with momentjs - javascript - Stack Overflow
I am trying to recover the date format according to the location. For example, if I use moment.locale('fr') retrieve "DD/MM/YYYY" or ...
Read more >
Date.prototype.toLocaleDateString() - JavaScript | MDN
In basic use without specifying a locale, a formatted string in the default locale and with default options is returned. const date =...
Read more >
locale — Internationalization services — Python 3.11.1 ...
Get a string with the name of the character encoding used in the selected locale. locale.D_T_FMT¶. Get a string that can be used...
Read more >
Checking the current Moment.js locale - momentjs.com
If you are changing locales frequently, you may want to know what locale is currently being used. This is as simple as calling...
Read more >
JavaScript Locale aware date time format that every web ...
// get client(browser) language const getLang = () => { return navigator.languages[0]; } // moment expects the lang code to passed in lower...
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