date changed to german
All checks were successful
Build and Deploy Astro App / build_and_deploy (push) Successful in 49s
All checks were successful
Build and Deploy Astro App / build_and_deploy (push) Successful in 49s
This commit is contained in:
parent
38254358bf
commit
4ded1c127d
4 changed files with 9 additions and 3 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import type { Post } from "../types/global";
|
||||
import { findImageByPath } from "../lib/findImage";
|
||||
import { Image } from "astro:assets";
|
||||
import { formatLocalizedDateString } from "../lib/formatDate";
|
||||
|
||||
interface Props {
|
||||
post: Post;
|
||||
|
|
@ -11,7 +12,7 @@ interface Props {
|
|||
const { post, url } = Astro.props;
|
||||
|
||||
const img = findImageByPath(post.image.path);
|
||||
const localeDate = new Date(post.date).toLocaleDateString()
|
||||
const localeDate = formatLocalizedDateString(post.date)
|
||||
---
|
||||
|
||||
<div class="wide-container">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
|
||||
import { findImageByPath } from "../lib/findImage";
|
||||
import { formatLocalizedDateString } from "../lib/formatDate";
|
||||
import type { Post } from "../types/global";
|
||||
|
||||
interface Props {
|
||||
|
|
@ -11,7 +12,7 @@ interface Props {
|
|||
const { post, url } = Astro.props;
|
||||
|
||||
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">
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import BackNav from "../components/BackNav.astro";
|
|||
import { findImageByPath } from "../lib/findImage";
|
||||
import type { Post } from "../types/global";
|
||||
import Main from "./Main.astro";
|
||||
import { formatLocalizedDateString } from "../lib/formatDate";
|
||||
|
||||
interface Props {
|
||||
frontmatter: Post;
|
||||
|
|
@ -12,7 +13,7 @@ interface Props {
|
|||
const { frontmatter } = Astro.props;
|
||||
|
||||
const titleImg = findImageByPath(frontmatter.image.path);
|
||||
const localeDate = new Date(frontmatter.date).toLocaleDateString()
|
||||
const localeDate = formatLocalizedDateString(frontmatter.date)
|
||||
---
|
||||
|
||||
<Main>
|
||||
|
|
|
|||
3
blog/src/lib/formatDate.ts
Normal file
3
blog/src/lib/formatDate.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export function formatLocalizedDateString(date: string): string {
|
||||
return new Date(date).toLocaleDateString('de-DE')
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue