moment deprecation warning
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 858
- PR merge metrics
- No merged PRs in 30d
Description
I wanted to change the locale for the react-datetime picker according to https://github.com/YouCanBookMe/react-datetime#i18n
But right after the localization import
`import localization from 'moment/locale/de';`
I get a deprecation warning in the console:
> Deprecation warning: use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.
It seems react-datetime uses this outdated defineLocale method.
Is there any easy way to change the locale without this warning?
EDIT: It seems it has to do with that I try to import a localizatino which is already existing. Because when I try to import
`import localization from 'moment/locale/fr';`
I don't get this error.
But if I don't do
`import localization from 'moment/locale/de';`
the date is still shown in English, and not in German. What can I do?
Contributor guide
Assessment
This issue has not been assessed yet.