This commit is contained in:
stardrophere
2026-03-12 01:50:08 +08:00
parent 966bcfbba4
commit e28b893a12
7 changed files with 123 additions and 14 deletions
+3
View File
@@ -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