From d7b44bda07c0be28a1e5225ad268e87cb227026c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kenneth=20Luj=C3=A1n=20Rosas?= Date: Wed, 28 Mar 2018 21:42:33 -0500 Subject: [PATCH] Fixes LocaleProvider `moment` usage (#9853) --- components/locale-provider/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/locale-provider/index.tsx b/components/locale-provider/index.tsx index c46c095c17..925def2812 100644 --- a/components/locale-provider/index.tsx +++ b/components/locale-provider/index.tsx @@ -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'); } }