8 lines
208 B
TypeScript
8 lines
208 B
TypeScript
import dayjs from "dayjs";
|
|
|
|
|
|
export function formatDate(time?: string | number | Date | dayjs.Dayjs | null, format = 'YYYY-MM-DD HH:mm:ss') {
|
|
if (!time) return '';
|
|
return dayjs(time).format(format)
|
|
}
|