archive fix

This commit is contained in:
2023-01-18 20:52:31 -05:00
parent eda778abf9
commit f605845f7e
2 changed files with 9 additions and 5 deletions
+7 -3
View File
@@ -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) => (
<div>
<a href={`/${post.slug}`}>{post.title}</a> -{" "}
{format(new Date(post.published_at), "MMM do, y")}
<a href={`/posts/${post.slug}`}>{post.title}</a> -{" "}
{formatInTimeZone(
new Date(post.published_at),
"America/New_York",
"MMM do, y"
)}
</div>
))
}