时间
This commit is contained in:
parent
f63eb4ad70
commit
9595119163
|
|
@ -437,7 +437,9 @@ const filteredAllocations = computed(() => {
|
|||
|
||||
function formatDate(dateStr: string): string {
|
||||
if (!dateStr) return '-'
|
||||
const date = new Date(dateStr)
|
||||
// 移除时间字符串末尾的Z(UTC标识),直接当作本地时间处理
|
||||
const cleanDateStr = dateStr.replace('Z', '').replace(/\+.*$/, '').replace(/-\d{2}:\d{2}$/, '')
|
||||
const date = new Date(cleanDateStr)
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user