From a1d3fb8df0e00faa3920d7f5085a52002e58574e Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Tue, 13 Jan 2026 18:42:05 +0100 Subject: Add polish language support --- src/utils/date.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/utils/date.ts') diff --git a/src/utils/date.ts b/src/utils/date.ts index 314a837..035d157 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -4,12 +4,14 @@ import { siteConfig } from "@/site.config"; export function getFormattedDate( date: Date | undefined, options?: Intl.DateTimeFormatOptions, + locale?: string, ): string { if (date === undefined) { return "Invalid Date"; } - return new Intl.DateTimeFormat(siteConfig.date.locale, { + const effectiveLocale = locale === "pl" ? "pl-PL" : siteConfig.date.locale; + return new Intl.DateTimeFormat(effectiveLocale, { ...(siteConfig.date.options as Intl.DateTimeFormatOptions), ...options, }).format(date); -- cgit v1.2.3