fix time calc and add drizzle link change

This commit is contained in:
Face 2025-07-15 18:35:30 +03:00
parent 0f13b74ddf
commit 32bfbf816c
4 changed files with 2210 additions and 3 deletions

View file

@ -123,7 +123,7 @@ export function formatRelativeTime(timestamp: string | Date): string {
if (hours < 24) {
const extraMinutes = minutes % 60;
return extraMinutes === 0 ? `${hours}hr` : `${hours}hr ${extraMinutes}m`;
return extraMinutes === 0 ? `${hours}h` : `${hours}h ${extraMinutes}m`;
}
if (days < 7) return `${days}d`;
@ -145,11 +145,11 @@ export function formatRelativeTime(timestamp: string | Date): string {
tempDate.setMonth(tempDate.getMonth() + adjustedMonths);
const remainingDays = Math.floor((now.getTime() - tempDate.getTime()) / (1000 * 60 * 60 * 24));
const weeks = Math.floor(remainingDays / 7);
return weeks === 0 ? `${adjustedMonths}m` : `${adjustedMonths}m ${weeks}w`;
return weeks === 0 ? `${adjustedMonths}mo` : `${adjustedMonths}mo ${weeks}w`;
}
const remainingMonths = adjustedMonths % 12;
return remainingMonths === 0 ? `${years}y` : `${years}y ${remainingMonths}m`;
return remainingMonths === 0 ? `${years}y` : `${years}y ${remainingMonths}mo`;
}
export function formatTimeAgo(date: string) {