mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-15 19:35:07 +08:00
✨ 2023-05-10:feat: 新增锁屏功能
This commit is contained in:
18
src/utils/dateUtil.ts
Normal file
18
src/utils/dateUtil.ts
Normal file
@ -0,0 +1,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
|
Reference in New Issue
Block a user