From 536936f65faa3a20e6ddb5efd12131e0c277e61c Mon Sep 17 00:00:00 2001 From: mrkmntal Date: Sat, 11 Apr 2026 13:18:39 -0400 Subject: [PATCH] Simplify the Travel Forecast screen --- server/scripts/modules/travelforecast.mjs | 17 ----------------- views/partials/travel.ejs | 4 ++-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/server/scripts/modules/travelforecast.mjs b/server/scripts/modules/travelforecast.mjs index 676e875..7290335 100644 --- a/server/scripts/modules/travelforecast.mjs +++ b/server/scripts/modules/travelforecast.mjs @@ -2,7 +2,6 @@ import STATUS from './status.mjs'; import { safePromiseAll } from './utils/fetch.mjs'; import { getSmallIconFromWmoCode } from './icons.mjs'; -import { DateTime } from '../vendor/auto/luxon.mjs'; import WeatherDisplay from './weatherdisplay.mjs'; import { registerDisplay } from './navigation.mjs'; import calculateScrollTiming from './utils/scroll-timing.mjs'; @@ -145,11 +144,6 @@ class TravelForecast extends WeatherDisplay { // list of cities. The second canvas is copied into the standard canvas to create the scroll super.drawCanvas(); - // set up variables - const cities = this.data; - - this.elem.querySelector('.header .title.dual .bottom').innerHTML = `For ${getTravelCitiesDayName(cities)}`; - this.finishDraw(); } @@ -307,16 +301,5 @@ const getTravelDisplayHeight = (elem) => { return Math.max(0, main.offsetHeight - (header?.offsetHeight ?? 0)); }; -// effectively returns early on the first found date -const getTravelCitiesDayName = (cities) => cities.reduce((dayName, city) => { - if (city && dayName === '') { - // today or tomorrow - const day = DateTime.local().plus({ days: (city.today) ? 0 : 1 }); - // return the day - return day.toLocaleString({ weekday: 'long' }); - } - return dayName; -}, ''); - // register display, not active by default registerDisplay(new TravelForecast(5, 'travel', false)); diff --git a/views/partials/travel.ejs b/views/partials/travel.ejs index d141c8e..28cfd79 100644 --- a/views/partials/travel.ejs +++ b/views/partials/travel.ejs @@ -1,4 +1,4 @@ -<%- include('header.ejs', {titleDual: {top: 'Travel Forecast', bottom: 'For '} , hasTime: true }) %> +<%- include('header.ejs', {title:'Travel Forecast', hasTime: true}) %>
LOW
@@ -12,4 +12,4 @@
- \ No newline at end of file +