fix(time-format): avoid displaying "0m ago"; show weeks instead (#235)

This commit is contained in:
Fernando López Guevara
2026-01-30 20:13:15 -03:00
committed by GitHub
parent 0a5c80bc9c
commit a7395055af

View File

@@ -84,7 +84,7 @@ export function formatTimestamp(
if (minutes < 60) return `${minutes}m ago`;
if (hours < 24) return `${hours}h ago`;
if (days < 7) return `${days}d ago`;
if (weeks < 4) return `${weeks}w ago`;
if (weeks < 4 || months == 0) return `${weeks}w ago`;
if (months < 12) return `${months}mo ago`;
return `${years}y ago`;
}