mirror of
https://github.com/stardrophere/InsightRadar.git
synced 2026-06-06 03:07:50 +08:00
optimize
This commit is contained in:
@@ -135,6 +135,9 @@ function getHotLevel(score: number): { label: string; color: string; bg: string
|
||||
}
|
||||
|
||||
function formatRelativeTime(dateStr: string): string {
|
||||
if (!dateStr.endsWith('Z') && !dateStr.includes('+')) {
|
||||
dateStr += 'Z' // 补偿 SQLite 丢失的 UTC 时区标识
|
||||
}
|
||||
const now = Date.now()
|
||||
const target = new Date(dateStr).getTime()
|
||||
const diff = now - target
|
||||
|
||||
Reference in New Issue
Block a user