mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 11:32:52 +08:00
docs(date-pciker): update demo docs (#40653)
This commit is contained in:
parent
b0ea26bf64
commit
654897e151
@ -1,7 +1,7 @@
|
|||||||
## zh-CN
|
## zh-CN
|
||||||
|
|
||||||
使用 `format` 属性,可以自定义日期显示格式。
|
使用 `format` 属性,可以自定义日期显示格式。当 `format` 为数组时,选择器输入框可以输入数组中任意一个有效格式。
|
||||||
|
|
||||||
## en-US
|
## 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.
|
||||||
|
@ -12,7 +12,8 @@ const dateFormat = 'YYYY/MM/DD';
|
|||||||
const weekFormat = 'MM/DD';
|
const weekFormat = 'MM/DD';
|
||||||
const monthFormat = 'YYYY/MM';
|
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) =>
|
const customFormat: DatePickerProps['format'] = (value) =>
|
||||||
`custom format: ${value.format(dateFormat)}`;
|
`custom format: ${value.format(dateFormat)}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user