Merge pull request #2158 from flopp999/patch-2

Weather - forecast change day of week
This commit is contained in:
Michael Teeuw 2020-10-20 09:34:16 +02:00 committed by GitHub
commit da302fce32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -13,6 +13,8 @@ _This release is scheduled to be released on 2021-01-01._
### Updated
- Weather module - forecast now show TODAY and TOMORROW instead of weekday, to make it easier to understand
### Deleted
### Fixed

View File

@ -10,7 +10,13 @@
{% set forecast = forecast.slice(0, numSteps) %}
{% for f in forecast %}
<tr {% if config.colored %}class="colored"{% endif %} {% if config.fade %}style="opacity: {{ currentStep | opacity(numSteps) }};"{% endif %}>
{% if (currentStep == 0) %}
<td class="day">{{ "TODAY" | translate }}</td>
{% elif (currentStep == 1) %}
<td class="day">{{ "TOMORROW" | translate }}</td>
{% else %}
<td class="day">{{ f.date.format('ddd') }}</td>
{% endif %}
<td class="bright weather-icon"><span class="wi weathericon wi-{{ f.weatherType }}"></span></td>
<td class="align-right bright max-temp">
{{ f.maxTemperature | roundValue | unit("temperature") }}

View File

@ -186,7 +186,7 @@ describe("Weather module", function () {
const weather = generateWeatherForecast();
await setup({ template, data: weather });
const days = ["Fri", "Sat", "Sun", "Mon", "Tue"];
const days = ["Today", "Tomorrow", "Sun", "Mon", "Tue"];
for (const [index, day] of days.entries()) {
await app.client.waitUntilTextExists(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(1)`, day, 10000);