diff --git a/web/src/pages/BandPage.tsx b/web/src/pages/BandPage.tsx index 6dfb29c..c135cb3 100644 --- a/web/src/pages/BandPage.tsx +++ b/web/src/pages/BandPage.tsx @@ -26,12 +26,12 @@ type FilterPill = "all" | "full band" | "guitar" | "vocals" | "drums" | "keys" | const PILLS: FilterPill[] = ["all", "full band", "guitar", "vocals", "drums", "keys", "commented"]; function formatDate(iso: string): string { - const d = new Date(iso + "T12:00:00"); + const d = new Date(iso.slice(0, 10) + "T12:00:00"); return d.toLocaleDateString(undefined, { year: "numeric", month: "short", day: "numeric" }); } function formatDateLabel(iso: string): string { - const d = new Date(iso + "T12:00:00"); + const d = new Date(iso.slice(0, 10) + "T12:00:00"); const today = new Date(); today.setHours(12, 0, 0, 0); const diffDays = Math.round((today.getTime() - d.getTime()) / (1000 * 60 * 60 * 24)); diff --git a/web/src/pages/SessionPage.tsx b/web/src/pages/SessionPage.tsx index e2e8173..7adab04 100644 --- a/web/src/pages/SessionPage.tsx +++ b/web/src/pages/SessionPage.tsx @@ -24,7 +24,7 @@ interface SessionDetail { } function formatDate(iso: string): string { - const d = new Date(iso + "T12:00:00"); + const d = new Date(iso.slice(0, 10) + "T12:00:00"); return d.toLocaleDateString(undefined, { weekday: "long", year: "numeric", month: "long", day: "numeric" }); }