Fixes LocaleProvider moment usage (#9853)

This commit is contained in:
Kenneth Luján Rosas 2018-03-28 21:42:33 -05:00 committed by Wei Zhu
parent 0d2a6c4ed9
commit d7b44bda07

View File

@ -1,6 +1,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import * as moment from 'moment';
import interopDefault from '../_util/interopDefault';
import { ModalLocale, changeConfirmLocale } from '../modal/locale';
export interface Locale {
@ -24,9 +25,9 @@ export interface LocaleProviderProps {
function setMomentLocale(locale: Locale) {
if (locale && locale.locale) {
moment.locale(locale.locale);
interopDefault(moment).locale(locale.locale);
} else {
moment.locale('en');
interopDefault(moment).locale('en');
}
}