fix(web): 任务耗时活计时钳0(本机时钟慢于服务端时短暂显示—) [nas]
CI/CD / test (push) Successful in 12s
CI/CD / nas-deploy (push) Successful in 29s
CI/CD / nas-verify (push) Successful in 17s

This commit is contained in:
2026-08-14 08:35:46 +08:00
parent 7e94339e42
commit 869a758b89
+2 -1
View File
@@ -212,7 +212,8 @@ function durationText(row: TaskListItem): string {
if (row.duration_s != null) return fmtDuration(row.duration_s)
if (isActive(row) && row.created_at) {
const start = new Date(row.created_at.replace(' ', 'T')).getTime()
if (!Number.isNaN(start) && start <= nowTick.value) return fmtDuration(Math.max(0, Math.floor((nowTick.value - start) / 1000)))
// 钳 0:本机时钟略慢于服务端时 start 会短暂"在未来",显示 0s 而非 —
if (!Number.isNaN(start)) return fmtDuration(Math.max(0, Math.floor((nowTick.value - start) / 1000)))
}
return '—'
}