doc: time text

This commit is contained in:
hamster1963 2024-10-09 14:08:18 +08:00
parent d04d6f19e3
commit 8ebd2859fc

View File

@ -88,13 +88,13 @@ export function formatRelativeTime(timestamp: number): string {
if (hours > 24) { if (hours > 24) {
const days = Math.floor(hours / 24); const days = Math.floor(hours / 24);
return `${days}天前`; return `${days}d`;
} else if (hours > 0) { } else if (hours > 0) {
return `${hours}小时前`; return `${hours}h`;
} else if (minutes >= 0) { } else if (minutes >= 0) {
return `${minutes}分钟前`; return `${minutes}m`;
} else { } else {
return "刚刚"; return "just now";
} }
} }