6da7f1d5 by lttnew

日期格式兼容性

1 parent a5474b95
......@@ -304,7 +304,12 @@ const getAuditStatusText = (status) => {
const filterTime = (row) => {
if (!row) return ''
return dayjs(row).format('YYYY年MM月DD日')
const date = new Date(String(row).replace(/-/g, '/'))
if (Number.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')
return `${year}年${month}月${day}日`
}
const filterType = (row) => {
......
......@@ -355,7 +355,12 @@ const getOrderLabel = (item) => {
const filterTime = (row) => {
if (!row) return ''
return dayjs(row).format('YYYY年MM月DD日')
const date = new Date(String(row).replace(/-/g, '/'))
if (Number.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')
return `${year}年${month}月${day}日`
}
const filterType = (row) => {
......
......@@ -258,7 +258,12 @@ onLoad((options) => {
})
const filterTime = (row) => {
if (!row) return ''
return dayjs(row).format('YYYY年MM月DD日')
const date = new Date(String(row).replace(/-/g, '/'))
if (Number.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')
return `${year}年${month}月${day}日`
}
// // 页面挂载初始化
......
......@@ -302,7 +302,8 @@ const getOrderLabel = (item) => {
const filterTime = (row) => {
if (!row) return ''
const date = new Date(row)
const date = new Date(String(row).replace(/-/g, '/'))
if (Number.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')
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!