From 96d3e8776d3ee0e142e4998b76c119c3462c7c96 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sat, 18 Oct 2025 19:57:41 +0200 Subject: [PATCH] [weather] feat: add configurable forecast date format option (#3918) I was a little disappointed that I couldn't change the date format in the forecast because it was hard-coded. This PR introduces a new option (`forecastDateFormat`) that allows the user to specify the format themselves. The default remains `ddd`. ## Before Screenshot From 2025-10-18 18-26-13 ## After (examples) ### `forecastDateFormat: "dddd"` Screenshot From 2025-10-18 18-26-27 ### `forecastDateFormat: "ddd, D MMM"` Screenshot From 2025-10-18 18-28-02 --- CHANGELOG.md | 2 ++ modules/default/weather/forecast.njk | 2 +- modules/default/weather/weather.js | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e76bfa90..ab0eb781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ planned for 2026-01-01 ### Added +- [weather] feat: add configurable forecast date format option (#3918) + ### Changed - [core] refactor: replace `module-alias` dependency with internal alias resolver (#3893) diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk index 91fef6ab..50c6bb53 100644 --- a/modules/default/weather/forecast.njk +++ b/modules/default/weather/forecast.njk @@ -16,7 +16,7 @@ {% elif (currentStep == 1) and config.ignoreToday == false and config.absoluteDates == false %} {{ "TOMORROW" | translate }} {% else %} - {{ f.date.format("ddd") }} + {{ f.date.format(config.forecastDateFormat) }} {% endif %} diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 8a81b276..6aed3f43 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -41,6 +41,7 @@ Module.register("weather", { onlyTemp: false, colored: false, absoluteDates: false, + forecastDateFormat: "ddd", // format for forecast date display, e.g., "ddd" = Mon, "dddd" = Monday, "D MMM" = 18 Oct hourlyForecastIncrements: 1 },