fix(utils): fix dateUtil.formatToDate ts type (#2345)

This commit is contained in:
hunshcn 2022-11-10 11:58:33 +08:00 committed by GitHub
parent 9ba15705b5
commit 384f929443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -13,10 +13,8 @@ export function formatToDateTime(
return dayjs(date).format(format);
}
export function formatToDate(
date: dayjs.Dayjs | undefined = undefined,
format = DATE_FORMAT,
): string {
export function formatToDate(date?: dayjs.ConfigType, format = DATE_FORMAT): string {
if (typeof date === 'number') date *= 1000;
return dayjs(date).format(format);
}