From b033142599f9361b2ab80252d478d3c974268a3c Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Tue, 3 Mar 2026 11:38:01 +0100 Subject: [PATCH] fix: locale parsing error in RecentPosts - safely parse locale string for toLocaleDateString - add 100 to images.qualities in next.config.mjs to suppress warnings --- components/home/RecentPosts.tsx | 13 ++++++++----- next.config.mjs | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/components/home/RecentPosts.tsx b/components/home/RecentPosts.tsx index 02111a09..cf15dec2 100644 --- a/components/home/RecentPosts.tsx +++ b/components/home/RecentPosts.tsx @@ -74,11 +74,14 @@ export default async function RecentPosts({ locale, data }: RecentPostsProps) { suppressHydrationWarning className="px-3 py-1 text-white/80 text-[10px] md:text-xs font-bold uppercase tracking-widest border border-white/20 rounded-full bg-white/10 backdrop-blur-md" > - {new Date(post.frontmatter.date).toLocaleDateString(locale || 'de', { - year: 'numeric', - month: 'short', - day: 'numeric', - })} + {new Date(post.frontmatter.date).toLocaleDateString( + ['en', 'de'].includes(locale) ? locale : 'de', + { + year: 'numeric', + month: 'short', + day: 'numeric', + }, + )} {(new Date(post.frontmatter.date) > new Date() || post.frontmatter.public === false) && ( diff --git a/next.config.mjs b/next.config.mjs index 03cc23a7..68fb5117 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -393,6 +393,7 @@ const nextConfig = { ]; }, images: { + qualities: [75, 100], formats: ['image/webp'], deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840], remotePatterns: [