mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-12-12 01:42:19 +00:00
[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 <img width="483" height="524" alt="Screenshot From 2025-10-18 18-26-13" src="https://github.com/user-attachments/assets/2de6af55-e73c-42e8-a3fe-7386ef5f90e0" /> ## After (examples) ### `forecastDateFormat: "dddd"` <img width="483" height="524" alt="Screenshot From 2025-10-18 18-26-27" src="https://github.com/user-attachments/assets/cd86c798-f1e4-4d75-adf9-c4e549aa2a51" /> ### `forecastDateFormat: "ddd, D MMM"` <img width="483" height="524" alt="Screenshot From 2025-10-18 18-28-02" src="https://github.com/user-attachments/assets/79aaa7b3-810a-4ab1-833c-09dfab7f457a" />
This commit is contained in:
committed by
GitHub
parent
37d1a3ae8f
commit
96d3e8776d
@@ -13,6 +13,8 @@ planned for 2026-01-01
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- [weather] feat: add configurable forecast date format option (#3918)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- [core] refactor: replace `module-alias` dependency with internal alias resolver (#3893)
|
- [core] refactor: replace `module-alias` dependency with internal alias resolver (#3893)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
{% elif (currentStep == 1) and config.ignoreToday == false and config.absoluteDates == false %}
|
{% elif (currentStep == 1) and config.ignoreToday == false and config.absoluteDates == false %}
|
||||||
<td class="day">{{ "TOMORROW" | translate }}</td>
|
<td class="day">{{ "TOMORROW" | translate }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td class="day">{{ f.date.format("ddd") }}</td>
|
<td class="day">{{ f.date.format(config.forecastDateFormat) }}</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td class="bright weather-icon">
|
<td class="bright weather-icon">
|
||||||
<span class="wi weathericon wi-{{ f.weatherType }}"></span>
|
<span class="wi weathericon wi-{{ f.weatherType }}"></span>
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ Module.register("weather", {
|
|||||||
onlyTemp: false,
|
onlyTemp: false,
|
||||||
colored: false,
|
colored: false,
|
||||||
absoluteDates: false,
|
absoluteDates: false,
|
||||||
|
forecastDateFormat: "ddd", // format for forecast date display, e.g., "ddd" = Mon, "dddd" = Monday, "D MMM" = 18 Oct
|
||||||
hourlyForecastIncrements: 1
|
hourlyForecastIncrements: 1
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user