优化一些显示问题

This commit is contained in:
gary.fu
2024-01-25 17:08:34 +08:00
parent 3887d39449
commit 5fa3fdbc78
17 changed files with 147 additions and 36 deletions

View File

@@ -1,5 +1,6 @@
import { ref } from 'vue'
import { $i18nBundle } from '@/messages'
import dayjs from 'dayjs'
const calcWithIf = menuItem => {
['icon', 'labelKey', 'label', 'html'].forEach(key => {
@@ -73,3 +74,15 @@ export const useParentRoute = function (route) {
}
return route
}
export const formatDate = (date, format) => {
if (date) {
return dayjs(date).format(format || 'YYYY-MM-DD HH:mm:ss')
}
}
export const formatDay = (date, format) => {
if (date) {
return dayjs(date).format(format || 'YYYY-MM-DD')
}
}