-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get the locale format? #680
How to get the locale format? #680
Comments
We will add it later to LocaleData plugin https://github.com/iamkun/dayjs/blob/dev/src/plugin/localeData/index.js You can get it in this way at the present
|
Thanks! |
@iamkun has this been added? currently trying to use react-dates from airbnb with dayjs. And it uses this longDateFormat method :/ |
It's not added at the moment |
Sorry for the delay, I'll add it today 😁 |
Added in #734, and will be available in the next release. Usage:
|
You are amazing thanks! |
## [1.8.18](v1.8.17...v1.8.18) (2019-12-18) ### Bug Fixes * Add missing locale type definition ([#716](#716)) ([cde5d0b](cde5d0b)) * Fix .locale() handel unsupported locale ([78ec173](78ec173)) * Update Italian locale (it) ([#727](#727)) ([5b53e98](5b53e98)) * Update locale (fa) ([#733](#733)) ([9ad2e47](9ad2e47)) * Update locale (zh-cn) ([#706](#706)) ([e31e544](e31e544)) * Update locale (zh-cn) meridiem ([#735](#735)) ([15d1b81](15d1b81)) * Update LocaleData plugin to support dayjs().longDateFormat() ([#734](#734)) ([aa0f210](aa0f210)), closes [#680](#680) * Update Mongolian (mn) locale relativeTime ([#753](#753)) ([6d51435](6d51435)) * Update Swedish locale (sv) fix ordinal error ([#745](#745)) ([49670d5](49670d5)), closes [#743](#743)
🎉 This issue has been resolved in version 1.8.18 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Seems that localeData().longDateFormat('L') is implemented only for instance: dayjs.localeData().longDateFormat('L') is missing. Adding |
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 |
## [1.8.18](iamkun/dayjs@v1.8.17...v1.8.18) (2019-12-18) ### Bug Fixes * Add missing locale type definition ([#716](iamkun/dayjs#716)) ([cde5d0b](iamkun/dayjs@cde5d0b)) * Fix .locale() handel unsupported locale ([78ec173](iamkun/dayjs@78ec173)) * Update Italian locale (it) ([#727](iamkun/dayjs#727)) ([5b53e98](iamkun/dayjs@5b53e98)) * Update locale (fa) ([#733](iamkun/dayjs#733)) ([9ad2e47](iamkun/dayjs@9ad2e47)) * Update locale (zh-cn) ([#706](iamkun/dayjs#706)) ([e31e544](iamkun/dayjs@e31e544)) * Update locale (zh-cn) meridiem ([#735](iamkun/dayjs#735)) ([15d1b81](iamkun/dayjs@15d1b81)) * Update LocaleData plugin to support dayjs().longDateFormat() ([#734](iamkun/dayjs#734)) ([aa0f210](iamkun/dayjs@aa0f210)), closes [#680](iamkun/dayjs#680) * Update Mongolian (mn) locale relativeTime ([#753](iamkun/dayjs#753)) ([6d51435](iamkun/dayjs@6d51435)) * Update Swedish locale (sv) fix ordinal error ([#745](iamkun/dayjs#745)) ([49670d5](iamkun/dayjs@49670d5)), closes [#743](iamkun/dayjs#743)
## [1.8.18](iamkun/dayjs@v1.8.17...v1.8.18) (2019-12-18) ### Bug Fixes * Add missing locale type definition ([#716](iamkun/dayjs#716)) ([cde5d0b](iamkun/dayjs@cde5d0b)) * Fix .locale() handel unsupported locale ([78ec173](iamkun/dayjs@78ec173)) * Update Italian locale (it) ([#727](iamkun/dayjs#727)) ([5b53e98](iamkun/dayjs@5b53e98)) * Update locale (fa) ([#733](iamkun/dayjs#733)) ([9ad2e47](iamkun/dayjs@9ad2e47)) * Update locale (zh-cn) ([#706](iamkun/dayjs#706)) ([e31e544](iamkun/dayjs@e31e544)) * Update locale (zh-cn) meridiem ([#735](iamkun/dayjs#735)) ([15d1b81](iamkun/dayjs@15d1b81)) * Update LocaleData plugin to support dayjs().longDateFormat() ([#734](iamkun/dayjs#734)) ([aa0f210](iamkun/dayjs@aa0f210)), closes [#680](iamkun/dayjs#680) * Update Mongolian (mn) locale relativeTime ([#753](iamkun/dayjs#753)) ([6d51435](iamkun/dayjs@6d51435)) * Update Swedish locale (sv) fix ordinal error ([#745](iamkun/dayjs#745)) ([49670d5](iamkun/dayjs@49670d5)), closes [#743](iamkun/dayjs#743)
## [1.8.18](iamkun/dayjs@v1.8.17...v1.8.18) (2019-12-18) ### Bug Fixes * Add missing locale type definition ([#716](iamkun/dayjs#716)) ([cde5d0b](iamkun/dayjs@cde5d0b)) * Fix .locale() handel unsupported locale ([78ec173](iamkun/dayjs@78ec173)) * Update Italian locale (it) ([#727](iamkun/dayjs#727)) ([5b53e98](iamkun/dayjs@5b53e98)) * Update locale (fa) ([#733](iamkun/dayjs#733)) ([9ad2e47](iamkun/dayjs@9ad2e47)) * Update locale (zh-cn) ([#706](iamkun/dayjs#706)) ([e31e544](iamkun/dayjs@e31e544)) * Update locale (zh-cn) meridiem ([#735](iamkun/dayjs#735)) ([15d1b81](iamkun/dayjs@15d1b81)) * Update LocaleData plugin to support dayjs().longDateFormat() ([#734](iamkun/dayjs#734)) ([aa0f210](iamkun/dayjs@aa0f210)), closes [#680](iamkun/dayjs#680) * Update Mongolian (mn) locale relativeTime ([#753](iamkun/dayjs#753)) ([6d51435](iamkun/dayjs@6d51435)) * Update Swedish locale (sv) fix ordinal error ([#745](iamkun/dayjs#745)) ([49670d5](iamkun/dayjs@49670d5)), closes [#743](iamkun/dayjs#743)
What is the equivalent of this moment code?
moment.localeData().longDateFormat('L')
The text was updated successfully, but these errors were encountered: