Changed weatherforecast to use dt_txt field

This commit is contained in:
Janne Kalliola 2018-05-08 18:45:38 +03:00
parent cfb39c6364
commit 0e2e8d2e2a
2 changed files with 3 additions and 2 deletions

View File

@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- In default module currentWeather/currentWeather.js line 296, 300, self.config.animationSpeed can not be found because the notificationReceived function does not have "self" variable.
- Fixed browser-side code to work on the Midori browser.
- Fixed issue where heat index was reporting incorrect values in Celsius and Fahrenheit. [#1263](https://github.com/MichMich/MagicMirror/issues/1263)
- Fixed weatherforecast to use dt_txt field instead of dt to handle timezones better
### Updated
- Updated Italian translation

View File

@ -333,8 +333,8 @@ Module.register("weatherforecast",{
var forecast = data.list[i];
this.parserDataWeather(forecast); // hack issue #1017
var day = moment(forecast.dt, "X").format("ddd");
var hour = moment(forecast.dt, "X").format("H");
var day = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("ddd");
var hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("H");
if (day !== lastDay) {
var forecastData = {