hunshcn
2022-11-11 5539190c3975bb0fc9b9c56d3b1662db79861a1a
提交 | 用户 | age
a89eee 1 /**
V 2  * Independent time operation tool to facilitate subsequent switch to dayjs
3  */
3fcfac 4 import dayjs from 'dayjs';
2f6253 5
522534 6 const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
090d84 7 const DATE_FORMAT = 'YYYY-MM-DD';
2f6253 8
553919 9 export function formatToDateTime(date?: dayjs.ConfigType, format = DATE_TIME_FORMAT): string {
3fcfac 10   return dayjs(date).format(format);
2f6253 11 }
12
384f92 13 export function formatToDate(date?: dayjs.ConfigType, format = DATE_FORMAT): string {
3fcfac 14   return dayjs(date).format(format);
2f6253 15 }
16
3fcfac 17 export const dateUtil = dayjs;
553919 18