mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-08 22:47:02 +02:00
fix(time-format): avoid displaying "0m ago"; show weeks instead (#235)
This commit is contained in:
committed by
GitHub
parent
0a5c80bc9c
commit
a7395055af
@@ -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`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user