Skip to content

Commit

Permalink
docs: update dayjs weekStart demo (#38990)
Browse files Browse the repository at this point in the history
close #38987
  • Loading branch information
afc163 committed Nov 25, 2022
1 parent e77b59a commit 72f7596
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions components/date-picker/index.en-US.md
Expand Up @@ -221,14 +221,15 @@ See FAQ [Date-related-components-locale-is-not-working?](/docs/react/faq#Date-re

Please use correct [language](/docs/react/i18n) ([#5605](https://github.com/ant-design/ant-design/issues/5605)), or update dayjs `locale` config:

- Example: <https://codesandbox.io/s/moment-day-of-week-6dby5>
- Alternate example: <https://stackblitz.com/edit/react-9aegkj>
- Example: <https://codesandbox.io/s/dayjs-day-of-week-x9tuj2?file=/demo.tsx>

```js
dayjs.locale('en', {
week: {
dow: 1,
},
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import 'dayjs/plugin/updateLocale';

dayjs.updateLocale('zh-cn', {
weekStart: 0,
});
```

Expand Down
13 changes: 7 additions & 6 deletions components/date-picker/index.zh-CN.md
Expand Up @@ -216,14 +216,15 @@ import locale from 'antd/locale/zh_CN';

### 如何修改周的起始日?

请使用正确的[语言包](/docs/react/i18n)[#5605](https://github.com/ant-design/ant-design/issues/5605)),或者修改 dayjs 的 `locale` 配置:<https://codesandbox.io/s/moment-day-of-week-6dby5>
请使用正确的[语言包](/docs/react/i18n-cn)[#5605](https://github.com/ant-design/ant-design/issues/5605)),或者修改 dayjs 的 `locale` 配置:<https://codesandbox.io/s/dayjs-day-of-week-x9tuj2?file=/demo.tsx>

```js
dayjs.locale('en', {
// 注意请修改你正在使用的 locale 语言,比如 zh-cn
week: {
dow: 1,
},
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import 'dayjs/plugin/updateLocale';

dayjs.updateLocale('zh-cn', {
weekStart: 0,
});
```

Expand Down

0 comments on commit 72f7596

Please sign in to comment.