Commit 384f9294433afb1b28de8944e4fdd36f7782bbf2
Committed by
GitHub
1 parent
9ba15705
fix(utils): fix dateUtil.formatToDate ts type (#2345)
Showing
1 changed file
with
2 additions
and
4 deletions
src/utils/dateUtil.ts
... | ... | @@ -13,10 +13,8 @@ export function formatToDateTime( |
13 | 13 | return dayjs(date).format(format); |
14 | 14 | } |
15 | 15 | |
16 | -export function formatToDate( | |
17 | - date: dayjs.Dayjs | undefined = undefined, | |
18 | - format = DATE_FORMAT, | |
19 | -): string { | |
16 | +export function formatToDate(date?: dayjs.ConfigType, format = DATE_FORMAT): string { | |
17 | + if (typeof date === 'number') date *= 1000; | |
20 | 18 | return dayjs(date).format(format); |
21 | 19 | } |
22 | 20 | ... | ... |