From a0c895d28b111c08720b00eed60fbd7b4a00ed31 Mon Sep 17 00:00:00 2001 From: ebby Date: Tue, 18 Aug 2026 16:16:33 +0200 Subject: [PATCH] made date localized --- blog/src/components/PostPreviewLarge.astro | 3 ++- blog/src/components/PostPreviewSmall.astro | 3 ++- blog/src/layouts/BlogPostLayout.astro | 3 ++- blog/src/pages/posts/XX0826_Ostseeurlaub.md | 2 +- blog/src/types/global.ts | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/blog/src/components/PostPreviewLarge.astro b/blog/src/components/PostPreviewLarge.astro index b67366e..a69b388 100644 --- a/blog/src/components/PostPreviewLarge.astro +++ b/blog/src/components/PostPreviewLarge.astro @@ -11,6 +11,7 @@ interface Props { const { post, url } = Astro.props; const img = findImageByPath(post.image.path); +const localeDate = new Date(post.date).toLocaleDateString() ---
@@ -22,7 +23,7 @@ const img = findImageByPath(post.image.path);

{post.title}

- {post.date} + {localeDate} Autor: {post.author}
diff --git a/blog/src/components/PostPreviewSmall.astro b/blog/src/components/PostPreviewSmall.astro index fafcfc8..24ab8ad 100644 --- a/blog/src/components/PostPreviewSmall.astro +++ b/blog/src/components/PostPreviewSmall.astro @@ -11,6 +11,7 @@ interface Props { const { post, url } = Astro.props; const img = findImageByPath(post.image.path) +const localeDate = new Date(post.date).toLocaleDateString() --- @@ -21,7 +22,7 @@ const img = findImageByPath(post.image.path)

{post.description}

Author: {post.author} - {post.date} + {localeDate}
diff --git a/blog/src/layouts/BlogPostLayout.astro b/blog/src/layouts/BlogPostLayout.astro index 5dd43bc..3eb3295 100644 --- a/blog/src/layouts/BlogPostLayout.astro +++ b/blog/src/layouts/BlogPostLayout.astro @@ -12,6 +12,7 @@ interface Props { const { frontmatter } = Astro.props; const titleImg = findImageByPath(frontmatter.image.path); +const localeDate = new Date(frontmatter.date).toLocaleDateString() ---
@@ -27,7 +28,7 @@ const titleImg = findImageByPath(frontmatter.image.path);
Autor: {frontmatter.author} - {frontmatter.date} + {localeDate}

diff --git a/blog/src/pages/posts/XX0826_Ostseeurlaub.md b/blog/src/pages/posts/XX0826_Ostseeurlaub.md index c00f78c..a2390b4 100644 --- a/blog/src/pages/posts/XX0826_Ostseeurlaub.md +++ b/blog/src/pages/posts/XX0826_Ostseeurlaub.md @@ -6,7 +6,7 @@ image: path: ostsee.jpg alt: Chiara und Tim vor einem Strand author: Tim -date: '2026-08-XX' +date: '2026-08-18' --- Eigentlich soll es hier um unser (zukünftiges) Boot und die Segelreisen gehen. diff --git a/blog/src/types/global.ts b/blog/src/types/global.ts index 65d8aa8..a27af5b 100644 --- a/blog/src/types/global.ts +++ b/blog/src/types/global.ts @@ -2,7 +2,7 @@ export interface Post { title: String, subtitle: String, description: String, - date: String, + date: string, author: String, image: { path: string,