fix: bugcollect 时间显示时区问题 - 追加 Z 表示 UTC 再转本地时间
Co-Authored-By: Claude <noreply@anthropic.com>
这个提交包含在:
父节点
1645e5a04e
当前提交
563a2c5628
@ -123,7 +123,9 @@ const filters = ref({
|
||||
|
||||
function formatTime(ts: string) {
|
||||
if (!ts) return '-'
|
||||
return new Date(ts).toLocaleString('zh-CN')
|
||||
// 服务端返回 UTC 时间(无时区标识),需追加 Z 表示 UTC
|
||||
const date = ts.includes('Z') || ts.includes('+') ? new Date(ts) : new Date(ts + 'Z')
|
||||
return date.toLocaleString('zh-CN')
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
|
||||
@ -170,7 +170,9 @@ function statusLabel(status: string): string {
|
||||
|
||||
function formatTime(ts: string): string {
|
||||
if (!ts) return '-'
|
||||
return new Date(ts).toLocaleString('zh-CN')
|
||||
// 服务端返回 UTC 时间(无时区标识),需追加 Z 表示 UTC
|
||||
const date = ts.includes('Z') || ts.includes('+') ? new Date(ts) : new Date(ts + 'Z')
|
||||
return date.toLocaleString('zh-CN')
|
||||
}
|
||||
|
||||
async function handleResolve() {
|
||||
|
||||
@ -143,7 +143,9 @@ function statusLabel(status: string): string {
|
||||
|
||||
function formatTime(ts: string) {
|
||||
if (!ts) return '-'
|
||||
return new Date(ts).toLocaleString('zh-CN')
|
||||
// 服务端返回 UTC 时间(无时区标识),需追加 Z 表示 UTC
|
||||
const date = ts.includes('Z') || ts.includes('+') ? new Date(ts) : new Date(ts + 'Z')
|
||||
return date.toLocaleString('zh-CN')
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
|
||||
@ -111,7 +111,9 @@ function statusLabel(status: string): string {
|
||||
|
||||
function formatTime(ts: string) {
|
||||
if (!ts) return '-'
|
||||
return new Date(ts).toLocaleString('zh-CN')
|
||||
// 服务端返回 UTC 时间(无时区标识),需追加 Z 表示 UTC
|
||||
const date = ts.includes('Z') || ts.includes('+') ? new Date(ts) : new Date(ts + 'Z')
|
||||
return date.toLocaleString('zh-CN')
|
||||
}
|
||||
|
||||
function truncateTitle(title: string, maxLen = 30): string {
|
||||
|
||||
@ -123,7 +123,9 @@ function riskTagType(score?: number) {
|
||||
|
||||
function formatTime(ts: string) {
|
||||
if (!ts) return '-'
|
||||
return new Date(ts).toLocaleString('zh-CN')
|
||||
// 服务端返回 UTC 时间(无时区标识),需追加 Z 表示 UTC
|
||||
const date = ts.includes('Z') || ts.includes('+') ? new Date(ts) : new Date(ts + 'Z')
|
||||
return date.toLocaleString('zh-CN')
|
||||
}
|
||||
|
||||
function truncateTitle(title: string, maxLen = 30): string {
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户