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 use localeData ?

See original GitHub issue

Hi i want to change moment.js to day.js in my library.

I wonder how to use localaleData in day.js. In case of moment.js

moment.localeData(locale).monthsShort()

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
iamkuncommented, Feb 23, 2020

@y0c update doc: https://day.js.org/docs/en/plugin/locale-data

We have an experimental plugin localeData from v1.8.10

import dayjs from 'dayjs'
import localeData from 'dayjs/plugin/localeData'
import 'dayjs/locale/ko'

dayjs.extend(localeData) // use plugin
dayjs.locale('ko') // use locale

dayjs().localeData().monthsShort(dayjs())

demo: https://runkit.com/embed/488qfv8m02rz

And if you only want to get the locale object, just import ko from 'dayjs/locale/ko', like this https://github.com/iamkun/dayjs/blob/dev/docs/en/I18n.md#customize

feedback is welcomed.

0reactions
iamkuncommented, Feb 23, 2020

@transtone do you mean weekdaysMin weekdaysShort ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android's LocaleData class. Accessing miscellaneous data in ...
LocaleData is, as the documentation currently puts it, a class for accessing miscellaneous data in the locale bundles. Well. Let's take a look....
Read more >
LocaleData | Android Developers
Gets the LocaleData object associated with the default FORMAT locale ... Google uses cookies to deliver its services, to personalize ads, and to...
Read more >
ICU4J LocaleData.MeasurementSystem - java - Stack Overflow
It basically forces you to use wrappers. The LocaleData class is not that useful, but you can learn few things. Quotation and locale...
Read more >
LocaleData
localeData API to supply locale data. var localeData = require('dayjs/plugin/localeData') dayjs.extend(localeData) dayjs().
Read more >
android_icu4j/src/main/java/android/icu/util/LocaleData.java
@param options Bitmask for options to apply to the exemplar pattern. * Specify zero to retrieve the exemplar set as it is. *...
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