From f605845f7eb622b1d31ebdc0975e00f1b1ab56d5 Mon Sep 17 00:00:00 2001 From: Graham Hall Date: Wed, 18 Jan 2023 20:52:31 -0500 Subject: [PATCH] archive fix --- src/pages/posts/index.astro | 10 +++++++--- src/styles/global.css | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/pages/posts/index.astro b/src/pages/posts/index.astro index 7078548..042af6c 100644 --- a/src/pages/posts/index.astro +++ b/src/pages/posts/index.astro @@ -1,5 +1,5 @@ --- -import { format } from "date-fns"; +import { formatInTimeZone } from "date-fns-tz"; import Layout from "../../layouts/Layout.astro"; const response = await fetch( @@ -17,8 +17,12 @@ const posts = await response.json(); { posts.objects.map((post) => (
- {post.title} -{" "} - {format(new Date(post.published_at), "MMM do, y")} + {post.title} -{" "} + {formatInTimeZone( + new Date(post.published_at), + "America/New_York", + "MMM do, y" + )}
)) } diff --git a/src/styles/global.css b/src/styles/global.css index c667bde..7b0e8c7 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -3,7 +3,7 @@ src: url(./fonts/Manrope-Regular.ttf) format("truetype"); font-weight: normal; font-style: normal; - font-display: swap; + font-display: block; } @font-face { @@ -11,7 +11,7 @@ src: url(./fonts/Manrope-Bold.ttf) format("truetype"); font-weight: bold; font-style: normal; - font-display: swap; + font-display: block; } :root {