change date format for news articles
This commit is contained in:
@ -3,7 +3,7 @@ import { Blocks } from "@/components/blocks/Blocks";
|
|||||||
import Image from "@/components/general/Image";
|
import Image from "@/components/general/Image";
|
||||||
import { graphql } from "@/gql";
|
import { graphql } from "@/gql";
|
||||||
import { NewsFragment } from "@/gql/graphql";
|
import { NewsFragment } from "@/gql/graphql";
|
||||||
import { formatExtendedDateTime } from "@/lib/date";
|
import { formatDate, formatExtendedDateTime } from "@/lib/date";
|
||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
export async function generateStaticParams() {
|
||||||
@ -67,7 +67,7 @@ export default async function Page({ params }: { params: { slug: string } }) {
|
|||||||
)}
|
)}
|
||||||
</figure>
|
</figure>
|
||||||
)}
|
)}
|
||||||
<p>{formatExtendedDateTime(news.firstPublishedAt, true, true)}</p>
|
<p>{formatDate(news.firstPublishedAt, 'd. MMMM yyyy')}</p>
|
||||||
</section>
|
</section>
|
||||||
<section className="pageContent">
|
<section className="pageContent">
|
||||||
<Blocks blocks={news.body} />
|
<Blocks blocks={news.body} />
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import styles from "./newsItem.module.scss";
|
import styles from "./newsItem.module.scss";
|
||||||
import Image from "../general/Image";
|
import Image from "../general/Image";
|
||||||
import { NewsFragment } from "@/lib/news";
|
import { NewsFragment } from "@/lib/news";
|
||||||
import { formatDate, compactDateFormat, formatExtendedDateTime } from "@/lib/date";
|
import { formatDate } from "@/lib/date";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
export const NewsItem = ({ news }: { news: NewsFragment }) => {
|
export const NewsItem = ({ news }: { news: NewsFragment }) => {
|
||||||
@ -22,7 +22,7 @@ export const NewsItem = ({ news }: { news: NewsFragment }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className={styles.text}>
|
<div className={styles.text}>
|
||||||
<p className={styles.date}>
|
<p className={styles.date}>
|
||||||
{formatExtendedDateTime(news.firstPublishedAt, true, true)}
|
{formatDate(news.firstPublishedAt, 'd. MMMM yyyy')}
|
||||||
</p>
|
</p>
|
||||||
<h2 className={styles.title}>{news.title}</h2>
|
<h2 className={styles.title}>{news.title}</h2>
|
||||||
<p className={styles.lead}>{news.excerpt}</p>
|
<p className={styles.lead}>{news.excerpt}</p>
|
||||||
|
Reference in New Issue
Block a user