arqex / arqex/react-datetime

moment deprecation warning

Open
#654 1 comment 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.