Skip to content

Commit bf5fcdc

Browse files
authored
docs(DatePicker): update docs (#6450)
1 parent 1977074 commit bf5fcdc

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

components/date-picker/index.en-US.md

+17
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,20 @@ Please refer [replace date](/docs/vue/replace-date)
206206
### Why config dayjs.locale globally not work?
207207

208208
DatePicker default set `locale` as `en` in v4. You can config DatePicker `locale` prop or [ConfigProvider `locale`](/components/config-provider) prop instead.
209+
210+
### How to modify start day of week?
211+
212+
Please use correct [language](/docs/vue/i18n) ([#5605](https://github.com/ant-design/ant-design/issues/5605)), or update dayjs `locale` config:
213+
214+
- Example: <https://codesandbox.io/s/dayjs-day-of-week-x9tuj2?file=/demo.tsx>
215+
216+
```js
217+
import dayjs from 'dayjs';
218+
import updateLocale from 'dayjs/plugin/updateLocale';
219+
import 'dayjs/locale/zh-cn';
220+
221+
dayjs.extend(updateLocale);
222+
dayjs.updateLocale('zh-cn', {
223+
weekStart: 0,
224+
});
225+
```

components/date-picker/index.zh-CN.md

+15
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,18 @@ export type FormatType = Generic | GenericFn | Array<Generic | GenericFn>;
207207
### 为何全局修改 dayjs.locale 不生效?
208208

209209
DatePicker 默认 `locale``en`。你可以通过 DatePicker 的 `locale` 属性来单独设置,也可以通过 [ConfigProvider `locale`](/components/config-provider-cn) 属性来配置。
210+
211+
### 如何修改周的起始日?
212+
213+
请使用正确的[语言包](/docs/vue/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>
214+
215+
```js
216+
import dayjs from 'dayjs';
217+
import updateLocale from 'dayjs/plugin/updateLocale';
218+
import 'dayjs/locale/zh-cn';
219+
220+
dayjs.extend(updateLocale);
221+
dayjs.updateLocale('zh-cn', {
222+
weekStart: 0,
223+
});
224+
```

0 commit comments

Comments
 (0)