Ant-design-pro: DatePicker 在中文模式下,月份的显示是英文月份

Created on 5 Sep 2018  ·  8Comments  ·  Source: ant-design/ant-design-pro

🛑 bug

Most helpful comment

在locales/zh-CN.js下加上下面的就可以解决

import 'moment/locale/zh-cn';

All 8 comments

Translation of this issue:


DatePicker In Chinese mode, the month display is English month

@yutingzhao1991 感觉我们的插件有问题

@chenshuai2144 你来看看?可能是 moment 那块没处理好。

感觉是 antd 的LocaleProvider问题

在locales/zh-CN.js下加上下面的就可以解决

import 'moment/locale/zh-cn';

嗯 应该是 umi-plugin-locale 这个插件没有加上 moment 的国际化资源。我来修复一下。

重复 issue 漫天飞

import {ConfigProvider} from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
import 'moment/locale/zh-cn';

ReactDOM.render(
    <ConfigProvider locale={zhCN}>
      <App/>
    </ConfigProvider>
    document.getElementById('root'),
);

大概这样写能解决,目前antd自带的moment的中文化路经是moment/local/zh-cn

Was this page helpful?
0 / 5 - 0 ratings