diff --git a/src/app/page.tsx b/src/app/page.tsx index b9aa5f7..bc4f25f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -9,6 +9,12 @@ import Head from "next/head"; import Link from "next/link"; import { AudioPlayer } from "@/components/AudioPlayer"; +// Helper to parse date string (YYYY-MM-DD) correctly across timezones +// Appends noon UTC to ensure consistent date display regardless of local timezone +function parseDate(dateStr: string): Date { + return new Date(`${dateStr}T12:00:00Z`); +} + interface Message { id: string; date: string; @@ -219,7 +225,7 @@ function BlogPageContent() { {getTitle(selectedPost.content)}
- {format(new Date(selectedPost.date), "MMMM d, yyyy")} + {format(parseDate(selectedPost.date), "MMMM d, yyyy")}
@@ -307,7 +313,7 @@ function BlogPageContent() { {getExcerpt(featuredPost.content, 200)}