fix: form setValues not support dayjs and Date value (#5064)

* fix: setFormValues not support  `dayjs object` value

* fix: setFormValues not support `Date` value

* chore: remove console log
This commit is contained in:
Netfan
2024-12-07 11:09:55 +08:00
committed by GitHub
parent 68ab73bdb5
commit b75a8e6a2b
2 changed files with 20 additions and 1 deletions

View File

@@ -16,3 +16,11 @@ export function formatDate(time: number | string, format = 'YYYY-MM-DD') {
export function formatDateTime(time: number | string) {
return formatDate(time, 'YYYY-MM-DD HH:mm:ss');
}
export function isDate(value: any): value is Date {
return value instanceof Date;
}
export function isDayjsObject(value: any): value is dayjs.Dayjs {
return dayjs.isDayjs(value);
}