fix(web): 任务耗时活计时钳0(本机时钟慢于服务端时短暂显示—) [nas]
This commit is contained in:
@@ -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 '—'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user