summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/date.ts4
1 files changed, 3 insertions, 1 deletions
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);