date changed to german
All checks were successful
Build and Deploy Astro App / build_and_deploy (push) Successful in 49s

This commit is contained in:
ebby 2026-08-21 14:04:52 +02:00
parent 38254358bf
commit 4ded1c127d
4 changed files with 9 additions and 3 deletions

View file

@ -2,6 +2,7 @@
import type { Post } from "../types/global"; import type { Post } from "../types/global";
import { findImageByPath } from "../lib/findImage"; import { findImageByPath } from "../lib/findImage";
import { Image } from "astro:assets"; import { Image } from "astro:assets";
import { formatLocalizedDateString } from "../lib/formatDate";
interface Props { interface Props {
post: Post; post: Post;
@ -11,7 +12,7 @@ interface Props {
const { post, url } = Astro.props; const { post, url } = Astro.props;
const img = findImageByPath(post.image.path); const img = findImageByPath(post.image.path);
const localeDate = new Date(post.date).toLocaleDateString() const localeDate = formatLocalizedDateString(post.date)
--- ---
<div class="wide-container"> <div class="wide-container">

View file

@ -1,6 +1,7 @@
--- ---
import { findImageByPath } from "../lib/findImage"; import { findImageByPath } from "../lib/findImage";
import { formatLocalizedDateString } from "../lib/formatDate";
import type { Post } from "../types/global"; import type { Post } from "../types/global";
interface Props { interface Props {
@ -11,7 +12,7 @@ interface Props {
const { post, url } = Astro.props; const { post, url } = Astro.props;
const img = findImageByPath(post.image.path) const img = findImageByPath(post.image.path)
const localeDate = new Date(post.date).toLocaleDateString() const localeDate = formatLocalizedDateString(post.date)
--- ---
<a href={url} class="no-link-link"> <a href={url} class="no-link-link">

View file

@ -4,6 +4,7 @@ import BackNav from "../components/BackNav.astro";
import { findImageByPath } from "../lib/findImage"; import { findImageByPath } from "../lib/findImage";
import type { Post } from "../types/global"; import type { Post } from "../types/global";
import Main from "./Main.astro"; import Main from "./Main.astro";
import { formatLocalizedDateString } from "../lib/formatDate";
interface Props { interface Props {
frontmatter: Post; frontmatter: Post;
@ -12,7 +13,7 @@ interface Props {
const { frontmatter } = Astro.props; const { frontmatter } = Astro.props;
const titleImg = findImageByPath(frontmatter.image.path); const titleImg = findImageByPath(frontmatter.image.path);
const localeDate = new Date(frontmatter.date).toLocaleDateString() const localeDate = formatLocalizedDateString(frontmatter.date)
--- ---
<Main> <Main>

View file

@ -0,0 +1,3 @@
export function formatLocalizedDateString(date: string): string {
return new Date(date).toLocaleDateString('de-DE')
}