src/utils/dateUtil.ts
@@ -6,6 +6,7 @@ const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss' const DATE_FORMAT = 'YYYY-MM-DD' const DATE_TIME_PATTERN_STRING = 'YYYYMMDDHHmmss' export function formatToDateTime(date?: dayjs.ConfigType, format = DATE_TIME_FORMAT): string { return dayjs(date).format(format) @@ -15,4 +16,8 @@ return dayjs(date).format(format) } export function formatToDateString(date?: dayjs.ConfigType, format = DATE_TIME_PATTERN_STRING): string { return dayjs(date).format(format) } export const dateUtil = dayjs