diff --git a/packages/components/time-picker/src/common/picker.vue b/packages/components/time-picker/src/common/picker.vue index 7bd527b389..d50affaa35 100644 --- a/packages/components/time-picker/src/common/picker.vue +++ b/packages/components/time-picker/src/common/picker.vue @@ -212,7 +212,7 @@ const valueEquals = function (a: Array | any, b: Array | any) { } const parser = function ( - date: Date | string, + date: string | number | Date, format: string, lang: string ): Dayjs { @@ -223,7 +223,11 @@ const parser = function ( return day.isValid() ? day : undefined } -const formatter = function (date: number | Date, format: string, lang: string) { +const formatter = function ( + date: string | number | Date, + format: string, + lang: string +) { if (isEmpty(format)) return date if (format === 'x') return +date return dayjs(date).locale(lang).format(format)