Skip to content

Commit

Permalink
docs: fix moment locale faq (#23895)
Browse files Browse the repository at this point in the history
close #23891
  • Loading branch information
afc163 committed May 6, 2020
1 parent aa3413b commit fdf0f2e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion components/config-provider/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ Some components use dynamic style to support wave effect. You can config `csp` p

#### Does the locale problem still exist in DatePicker even if ConfigProvider `locale` is used?

Please make sure you set moment locale by `moment.locale('zh-cn')` or that you don't have two different versions of moment.
Please make sure you set moment locale or that you don't have two different versions of moment.

```js
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
```

#### Modal throw error when setting `getPopupContainer`?

Expand Down
7 changes: 6 additions & 1 deletion components/config-provider/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ return (

#### 为什么我使用了 ConfigProvider `locale`,时间类组件的国际化还有问题?

请检查是否正确设置了 `moment.locale('zh-cn')`。或者是否有两个版本的 moment 共存。
请检查是否正确设置了 moment 语言包,或者是否有两个版本的 moment 共存。

```js
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
```

#### 配置 `getPopupContainer` 导致 Modal 报错?

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"copy-to-clipboard": "^3.2.0",
"css-animation": "^1.5.0",
"lodash": "^4.17.13",
"moment": "~2.25.1",
"moment": "~2.25.3",
"omit.js": "^1.0.2",
"prop-types": "^15.7.2",
"raf": "^3.4.1",
Expand Down

0 comments on commit fdf0f2e

Please sign in to comment.