From 9d4d17601376094fb18e23d951bbb459bc653ef6 Mon Sep 17 00:00:00 2001 From: Alex Hope-O'Connor Date: Tue, 23 Dec 2025 21:03:33 +1000 Subject: [PATCH] Fix forecastTime to use API metadata instead of current time - Use metadata.forecastTime from API response instead of endTime in fetchHistoricalFrames - Ensures forecast time displays correctly in user's browser timezone - Fixes issue where forecast time was showing incorrect timezone --- custom_components/bom_local/www/bom-local-card.js | 2 +- docker-compose.test.yml | 2 +- src/services/radar-api-service.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/bom_local/www/bom-local-card.js b/custom_components/bom_local/www/bom-local-card.js index faf3d11..6d8a159 100644 --- a/custom_components/bom_local/www/bom-local-card.js +++ b/custom_components/bom_local/www/bom-local-card.js @@ -1300,7 +1300,7 @@ class RadarApiService { frames: allFrames, lastUpdated: endTime, observationTime: metadata.observationTime || (newestCacheFolder === null || newestCacheFolder === void 0 ? void 0 : newestCacheFolder.observationTime) || endTime, - forecastTime: endTime, + forecastTime: metadata.forecastTime || endTime, weatherStation: metadata.weatherStation, distance: metadata.distance, cacheIsValid: (_a = metadata.cacheIsValid) !== null && _a !== void 0 ? _a : true, diff --git a/docker-compose.test.yml b/docker-compose.test.yml index c4ffc07..5dc06bb 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -22,7 +22,7 @@ services: # Application configuration - CACHEDIRECTORY=/app/cache - CACHERETENTIONHOURS=24 - - TIMEZONE=Australia/Brisbane + - TIMEZONE=Australia/Sydney # Debug output enabled by default for test environment - DEBUG__ENABLED=true - DEBUG__WAITMS=2000 diff --git a/src/services/radar-api-service.ts b/src/services/radar-api-service.ts index 62429c8..7c66761 100644 --- a/src/services/radar-api-service.ts +++ b/src/services/radar-api-service.ts @@ -154,7 +154,7 @@ export class RadarApiService { frames: allFrames, lastUpdated: endTime, observationTime: metadata.observationTime || newestCacheFolder?.observationTime || endTime, - forecastTime: endTime, + forecastTime: metadata.forecastTime || endTime, weatherStation: metadata.weatherStation, distance: metadata.distance, cacheIsValid: metadata.cacheIsValid ?? true,