6da7f1d5 by lttnew

日期格式兼容性

1 parent a5474b95
...@@ -304,7 +304,12 @@ const getAuditStatusText = (status) => { ...@@ -304,7 +304,12 @@ const getAuditStatusText = (status) => {
304 304
305 const filterTime = (row) => { 305 const filterTime = (row) => {
306 if (!row) return '' 306 if (!row) return ''
307 return dayjs(row).format('YYYY年MM月DD日') 307 const date = new Date(String(row).replace(/-/g, '/'))
308 if (Number.isNaN(date.getTime())) return ''
309 const year = date.getFullYear()
310 const month = String(date.getMonth() + 1).padStart(2, '0')
311 const day = String(date.getDate()).padStart(2, '0')
312 return `${year}年${month}月${day}日`
308 } 313 }
309 314
310 const filterType = (row) => { 315 const filterType = (row) => {
......
...@@ -355,7 +355,12 @@ const getOrderLabel = (item) => { ...@@ -355,7 +355,12 @@ const getOrderLabel = (item) => {
355 355
356 const filterTime = (row) => { 356 const filterTime = (row) => {
357 if (!row) return '' 357 if (!row) return ''
358 return dayjs(row).format('YYYY年MM月DD日') 358 const date = new Date(String(row).replace(/-/g, '/'))
359 if (Number.isNaN(date.getTime())) return ''
360 const year = date.getFullYear()
361 const month = String(date.getMonth() + 1).padStart(2, '0')
362 const day = String(date.getDate()).padStart(2, '0')
363 return `${year}年${month}月${day}日`
359 } 364 }
360 365
361 const filterType = (row) => { 366 const filterType = (row) => {
......
...@@ -258,7 +258,12 @@ onLoad((options) => { ...@@ -258,7 +258,12 @@ onLoad((options) => {
258 }) 258 })
259 const filterTime = (row) => { 259 const filterTime = (row) => {
260 if (!row) return '' 260 if (!row) return ''
261 return dayjs(row).format('YYYY年MM月DD日') 261 const date = new Date(String(row).replace(/-/g, '/'))
262 if (Number.isNaN(date.getTime())) return ''
263 const year = date.getFullYear()
264 const month = String(date.getMonth() + 1).padStart(2, '0')
265 const day = String(date.getDate()).padStart(2, '0')
266 return `${year}年${month}月${day}日`
262 } 267 }
263 268
264 // // 页面挂载初始化 269 // // 页面挂载初始化
......
...@@ -302,7 +302,8 @@ const getOrderLabel = (item) => { ...@@ -302,7 +302,8 @@ const getOrderLabel = (item) => {
302 302
303 const filterTime = (row) => { 303 const filterTime = (row) => {
304 if (!row) return '' 304 if (!row) return ''
305 const date = new Date(row) 305 const date = new Date(String(row).replace(/-/g, '/'))
306 if (Number.isNaN(date.getTime())) return ''
306 const year = date.getFullYear() 307 const year = date.getFullYear()
307 const month = String(date.getMonth() + 1).padStart(2, '0') 308 const month = String(date.getMonth() + 1).padStart(2, '0')
308 const day = String(date.getDate()).padStart(2, '0') 309 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!