Flex
2025-06-13 fd2f637bae8270af9fa3a5ce0e3236a78ef99242
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * Independent time operation tool to facilitate subsequent switch to dayjs
 */
// TODO 芋艿:【锁屏】可能后面删除掉
import dayjs from 'dayjs'
 
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
const DATE_FORMAT = 'YYYY-MM-DD'
 
export function formatToDateTime(date?: dayjs.ConfigType, format = DATE_TIME_FORMAT): string {
  return dayjs(date).format(format)
}
 
export function formatToDate(date?: dayjs.ConfigType, format = DATE_FORMAT): string {
  return dayjs(date).format(format)
}
 
export const dateUtil = dayjs