Simplify the Travel Forecast screen
Some checks are pending
build-docker / Build Image (push) Waiting to run

This commit is contained in:
mrkmntal 2026-04-11 13:18:39 -04:00
commit 536936f65f
2 changed files with 2 additions and 19 deletions

View file

@ -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));

View file

@ -1,4 +1,4 @@
<%- include('header.ejs', {titleDual: {top: 'Travel Forecast', bottom: 'For '} , hasTime: true }) %>
<%- include('header.ejs', {title:'Travel Forecast', hasTime: true}) %>
<div class="main has-scroll travel">
<div class="column-headers">
<div class="temp low">LOW</div>
@ -12,4 +12,4 @@
<div class="temp high"></div>
</div>
</div>
</div>
</div>