Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ANTD DatePicker Locale

Tags:

antd

I have been working with ANTD since version 2.10. DatePicker had no problems with localization. When I switched to version 2.12.8 DataPicker began to display the months and days of the week in English, although the prompts in the TextBox are displayed correctly in any selected language. It seems that DatePicker does not interact correctly with the moment.js. How can I fix this? The application is built on the basis of Create-React-App.

...
import { LocaleProvider } from 'antd';
import ruRU from 'antd/lib/locale-provider/ru_RU';
...

<Provider store={store}>
    <Router>
        <LocaleProvider locale={ruRU}>
            <App/>
        </LocaleProvider>
    </Router>
</Provider>
like image 439
kvv Avatar asked Sep 04 '17 12:09

kvv


1 Answers

This one line worked for me:

import 'moment/locale/ru';

See 'note' in Antd docs: antd range picker docs

like image 110
Maupa Avatar answered Dec 07 '22 17:12

Maupa