From 3f439e0d9a1319d3b513b1277090c9510467194a Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Mon, 31 Jul 2023 12:17:33 +0400 Subject: [PATCH] Fixing date formatting, attempt 4, now I've checked that polyfill works on my VPS --- src/components/Article.astro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Article.astro b/src/components/Article.astro index bffa206..62b0d53 100644 --- a/src/components/Article.astro +++ b/src/components/Article.astro @@ -2,6 +2,7 @@ import ArticleMenu from './ArticleMenu.astro'; import { AstroComponentFactory } from 'astro/dist/runtime/server'; +import IntlPolyfill from 'intl'; export interface Props { PostContent: AstroComponentFactory; @@ -29,7 +30,7 @@ function formatDate(obj?: Date) { const formatter = ( Intl.DateTimeFormat.supportedLocalesOf(locale).length ? Intl.DateTimeFormat : - require('intl').DateTimeFormat + IntlPolyfill.DateTimeFormat ); return new formatter(locale).format(obj);