Uhrzeit fix
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user