From e8ad33337b90e2dc543db5d7274b73efb3c3104a Mon Sep 17 00:00:00 2001 From: Dmitriy Kovalenko Date: Mon, 14 Oct 2019 18:34:09 +0300 Subject: [PATCH] Fix not working moment example (#1353) --- docs/pages/localization/Moment.example.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/pages/localization/Moment.example.jsx b/docs/pages/localization/Moment.example.jsx index 33fb1568e..729fc3631 100644 --- a/docs/pages/localization/Moment.example.jsx +++ b/docs/pages/localization/Moment.example.jsx @@ -1,12 +1,14 @@ +import moment from 'moment'; import MomentUtils from '@date-io/moment'; import MoreIcon from '@material-ui/icons/MoreVert'; import React, { useState, useCallback } from 'react'; import { IconButton, Menu, MenuItem } from '@material-ui/core'; import { DatePicker, MuiPickersUtilsProvider } from '@material-ui/pickers'; - import 'moment/locale/fr'; import 'moment/locale/ru'; +moment.locale('fr'); // it is required to select default locale manually + const localeMap = { en: 'en', fr: 'fr', @@ -24,15 +26,17 @@ function MomentLocalizationExample() { }, []); const selectLocale = useCallback(locale => { + moment.locale(locale); + setLocale(locale); setAnchorEl(null); }, []); return ( - + handleDateChange(date)} InputProps={{ endAdornment: (