fix: formatter func parameter type miss (#6186)

* fix: formatter func parameter type miss

* fix: lint prettier and other type miss
This commit is contained in:
Zong 2022-02-21 14:19:07 +08:00 committed by GitHub
parent 12b8e93649
commit 8ef1e305bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,7 +212,7 @@ const valueEquals = function (a: Array<Date> | any, b: Array<Date> | 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)