fix(events): show the venue-local concert time consistently
Backend sent the UTC `dateTime` (a 20:00 local show read as 08:00Z), and Android's ZonedDateTime.parse choked on zone-less values → some rows had a wrong time, others none at all. - Backend: prefer localDate+localTime (venue-local, naive) over the UTC instant. - Android: parse a naive LocalDateTime first, fall back to ZonedDateTime for older "…Z" values. Web already renders the naive string as-is. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
f27eaf9c82
commit
2208ce77b6
2 files changed
+15
-6
No files matched your search
@@ -393,9 +393,12 @@ app.get('/api/events/:artist', (req, res) => {
|
||||
const events = raw.map(e => {
|
||||
const venue = e._embedded?.venues?.[0] || {};
|
||||
const start = e.dates?.start || {};
|
||||
const dt = start.dateTime || (start.localDate
|
||||
// Prefer the venue-LOCAL date/time (localDate + localTime) over the UTC `dateTime` —
|
||||
// otherwise a 20:00 local show is shown as its 08:00Z UTC instant. Sent as a naive local
|
||||
// datetime string (no zone); the clients render it as-is.
|
||||
const dt = (start.localDate
|
||||
? `${start.localDate}T${start.localTime || '00:00:00'}`
|
||||
: null);
|
||||
: start.dateTime) || null;
|
||||
const soldOut = e.dates?.status?.code === 'offsale' ||
|
||||
e.dates?.status?.code === 'cancelled';
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user