feat: lang
TS Lint / Oxlint (push) Successful in 43s
TS Lint / TypeScript (push) Successful in 49s
TS Lint / ESLint (push) Successful in 1m10s

This commit is contained in:
2026-07-14 10:45:35 +02:00
parent d969b9e21b
commit c7b1f3ed49
16 changed files with 237 additions and 55 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import { formatDistanceToNow } from "date-fns";
import { enUS, fr } from 'date-fns/locale';
export function relativeTime(date: Date): string {
return formatDistanceToNow(date, {addSuffix: true, includeSeconds: false});
export function relativeTime(date: Date, locale: string): string {
return formatDistanceToNow(date, {addSuffix: true, includeSeconds: false, locale: locale === 'fr' ? fr : enUS});
}