diff --git a/components/date-picker/index.en-US.md b/components/date-picker/index.en-US.md index 59421cb5f..376643a67 100644 --- a/components/date-picker/index.en-US.md +++ b/components/date-picker/index.en-US.md @@ -206,3 +206,20 @@ Please refer [replace date](/docs/vue/replace-date) ### Why config dayjs.locale globally not work? DatePicker default set `locale` as `en` in v4. You can config DatePicker `locale` prop or [ConfigProvider `locale`](/components/config-provider) prop instead. + +### How to modify start day of week? + +Please use correct [language](/docs/vue/i18n) ([#5605](https://github.com/ant-design/ant-design/issues/5605)), or update dayjs `locale` config: + +- Example: + +```js +import dayjs from 'dayjs'; +import updateLocale from 'dayjs/plugin/updateLocale'; +import 'dayjs/locale/zh-cn'; + +dayjs.extend(updateLocale); +dayjs.updateLocale('zh-cn', { + weekStart: 0, +}); +``` diff --git a/components/date-picker/index.zh-CN.md b/components/date-picker/index.zh-CN.md index 0b861a498..a4ddbbf9a 100644 --- a/components/date-picker/index.zh-CN.md +++ b/components/date-picker/index.zh-CN.md @@ -207,3 +207,18 @@ export type FormatType = Generic | GenericFn | Array; ### 为何全局修改 dayjs.locale 不生效? DatePicker 默认 `locale` 为 `en`。你可以通过 DatePicker 的 `locale` 属性来单独设置,也可以通过 [ConfigProvider `locale`](/components/config-provider-cn) 属性来配置。 + +### 如何修改周的起始日? + +请使用正确的[语言包](/docs/vue/i18n-cn)([#5605](https://github.com/ant-design/ant-design/issues/5605)),或者修改 dayjs 的 `locale` 配置: + +```js +import dayjs from 'dayjs'; +import updateLocale from 'dayjs/plugin/updateLocale'; +import 'dayjs/locale/zh-cn'; + +dayjs.extend(updateLocale); +dayjs.updateLocale('zh-cn', { + weekStart: 0, +}); +```