mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
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>
This commit is contained in:
parent
cb338a2c61
commit
d9d44195a6
@ -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…
Reference in New Issue
Block a user