|
|
@@ -5,7 +5,9 @@ export { storage } from './storage.js'
|
|
|
export { fmtDictName, getDictColor } from './dict.js'
|
|
|
|
|
|
export const formatTime = (time, format = 'YYYY-MM-DD HH:mm:ss') => {
|
|
|
+ if (!time) return '-'
|
|
|
const date = new Date(time)
|
|
|
+ if (isNaN(date.getTime())) return '-'
|
|
|
const year = date.getFullYear()
|
|
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
|
const day = String(date.getDate()).padStart(2, '0')
|