Uhrzeit fix

This commit is contained in:
2025-10-08 12:07:56 +02:00
parent e378ce4a97
commit 495bfe71a3
14 changed files with 176 additions and 165 deletions

View File

@@ -5,7 +5,7 @@ import { getEvent } from '../utils/api'
import { googleCalendarUrl, downloadICS } from '../utils/calendar'
import { track, events as ga } from '../utils/analytics'
const apiBaseUrl = (import.meta.env.VITE_API_BASE_URL || 'http://localhost:4001').replace(/\/$/, '')
const apiBaseUrl = (import.meta.env.VITE_API_BASE_URL || '').replace(/\/$/, '')
function parseTime(timeStr) {
if (!timeStr) return '10:00'
@@ -47,13 +47,14 @@ function getFallbackImage(event) {
}
function formatDate(dateStr) {
const date = new Date(dateStr)
const date = new Date(dateStr + 'T00:00:00')
if (Number.isNaN(date.getTime())) return dateStr
return date.toLocaleDateString(undefined, {
return date.toLocaleDateString('en-US', {
weekday: 'long',
month: 'long',
day: 'numeric',
year: 'numeric',
timeZone: 'America/Chicago',
})
}
@@ -182,7 +183,7 @@ export default function EventDetail() {
</p>
<h1 className="font-heading text-display30 text-ink">{event.title}</h1>
<p className="text-muted text-sm">
{displayDate} {displayTime}{event.location ? `${event.location}` : ''}
{displayDate} {displayTime} CT{event.location ? `${event.location}` : ''}
</p>
</header>
<div className="space-y-4 text-body leading-relaxed">
@@ -229,7 +230,7 @@ export default function EventDetail() {
<dl className="space-y-4 text-sm">
<div>
<dt className="font-semibold text-ink">When</dt>
<dd className="text-muted">{displayDate} · {displayTime}</dd>
<dd className="text-muted">{displayDate} · {displayTime} CT</dd>
</div>
{event.location && (
<div>