2.9.7
Fix day cycle
This commit is contained in:
+9
-2
@@ -280,9 +280,16 @@ export function UTCIForecast() {
|
||||
// Synthesize a storm overlay (lightning) when the simulated hour is wet;
|
||||
// outside playback keep the real active event.
|
||||
const scopeEvent = simRow ? ((simRow.precip ?? 0) >= 4 ? { id: 'storm' } : null) : lensEvent;
|
||||
// Local clock label for the playback button, e.g. "14:30".
|
||||
// Local clock label for the playback button. The playback is a ROLLING 24h
|
||||
// window from now, so it crosses into the next day — prefix the weekday
|
||||
// (e.g. "Wed 14:30") so it's clear the scope has rolled past midnight and is
|
||||
// showing tomorrow's hour, not today's table row for the same clock time.
|
||||
const simClock = (playing && scopeDt)
|
||||
? new Date(scopeDt.getTime() + utcOffsetMs).toISOString().slice(11, 16)
|
||||
? (() => {
|
||||
const d = new Date(scopeDt.getTime() + utcOffsetMs);
|
||||
const wd = d.toLocaleDateString('en-GB', { weekday: 'short', timeZone: 'UTC' });
|
||||
return `${wd} ${d.toISOString().slice(11, 16)}`;
|
||||
})()
|
||||
: null;
|
||||
const staleThreshMs = isPro ? 15 * 60 * 1000 : 30 * 60 * 1000;
|
||||
const isStale = fetchedAt ? (now - fetchedAt) > staleThreshMs : false;
|
||||
|
||||
@@ -16,5 +16,9 @@
|
||||
"home": 2,
|
||||
"vehicle": 1
|
||||
}
|
||||
},
|
||||
"2026-06-11": {
|
||||
"visits": 2,
|
||||
"profiles": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user