docs(date-pciker): update demo docs (#40653)

This commit is contained in:
Wuxh 2023-02-09 12:59:30 +08:00 committed by GitHub
parent b0ea26bf64
commit 654897e151
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
## zh-CN
使用 `format` 属性,可以自定义日期显示格式。
使用 `format` 属性,可以自定义日期显示格式。`format` 为数组时,选择器输入框可以输入数组中任意一个有效格式。
## en-US
We can set the date format by `format`.
We can set the date format by `format`. When `format` is an array, the input box can be entered in any of the valid formats of the array.

View File

@ -12,7 +12,8 @@ const dateFormat = 'YYYY/MM/DD';
const weekFormat = 'MM/DD';
const monthFormat = 'YYYY/MM';
const dateFormatList = ['DD/MM/YYYY', 'DD/MM/YY'];
/** Manually entering any of the following formats will perform date parsing */
const dateFormatList = ['DD/MM/YYYY', 'DD/MM/YY', 'DD-MM-YYYY', 'DD-MM-YY'];
const customFormat: DatePickerProps['format'] = (value) =>
`custom format: ${value.format(dateFormat)}`;