|
@@ -7,11 +7,11 @@ const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
const DATE_FORMAT = 'YYYY-MM-DD';
|
|
const DATE_FORMAT = 'YYYY-MM-DD';
|
|
|
|
|
|
export function formatToDateTime(date?: dayjs.ConfigType, format = DATE_TIME_FORMAT): string {
|
|
export function formatToDateTime(date?: dayjs.ConfigType, format = DATE_TIME_FORMAT): string {
|
|
- return dayjs(date).format(format);
|
|
|
|
|
|
+ return date ? dayjs(date).format(format) : '';
|
|
}
|
|
}
|
|
|
|
|
|
export function formatToDate(date?: dayjs.ConfigType, format = DATE_FORMAT): string {
|
|
export function formatToDate(date?: dayjs.ConfigType, format = DATE_FORMAT): string {
|
|
- return dayjs(date).format(format);
|
|
|
|
|
|
+ return date ? dayjs(date).format(format) : '';
|
|
}
|
|
}
|
|
|
|
|
|
export const dateUtil = dayjs;
|
|
export const dateUtil = dayjs;
|