docs: fix dayjs updateLocale usage (#43250)

* fix:dayjs中没有updateLocale方法,直接使用local("zh-cn")

codesandbox中的示例也报错了。。找不到updateLocale方法

* Apply suggestions from code review

Signed-off-by: afc163 <afc163@gmail.com>

* Update index.en-US.md

---------

Signed-off-by: afc163 <afc163@gmail.com>
Co-authored-by: afc163 <afc163@gmail.com>
pull/43303/head
LHH 2 years ago committed by GitHub
parent cb338a2c61
commit d9d44195a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -248,8 +248,9 @@ Please use correct [language](/docs/react/i18n) ([#5605](https://github.com/ant-
```js
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import 'dayjs/plugin/updateLocale';
import updateLocale from 'dayjs/plugin/updateLocale';
dayjs.extend(updateLocale);
dayjs.updateLocale('zh-cn', {
weekStart: 0,
});

@ -243,8 +243,10 @@ export type FormatType = Generic | GenericFn | Array<Generic | GenericFn>;
```js
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import 'dayjs/plugin/updateLocale';
import updateLocale from 'dayjs/plugin/updateLocale';
dayjs.extend(updateLocale);
dayjs.updateLocale('zh-cn', {
weekStart: 0,
});

Loading…
Cancel
Save