Fine tuning date formatting.

This commit is contained in:
2026-08-22 00:09:57 +00:00
parent 29f8fac013
commit c77598adc7
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -92,7 +92,7 @@ export function calcReadStats(visits) {
totalVisitSeconds += secs.reduce((a, b) => a + b, 0)
for (const [path, s] of Object.entries(v.read || {})) {
if (s >= MIN_READ_SECONDS) {
;(perArticle[path] || (perArticle[path] = [])).push(s)
; (perArticle[path] || (perArticle[path] = [])).push(s)
}
}
}
@@ -185,6 +185,8 @@ export function formatWhen(ts, now = Date.now()) {
if (adiff <= 86400000) {
return formatter
.format(Math.round(diff / 3600000), 'hour')
.replace('hours', 'h')
.replace('hour', 'h')
.replaceAll(' ', '\u202F')
}
if (adiff <= 604800000) {