diff --git a/CHANGELOG.md b/CHANGELOG.md index 527b9629..3c242e50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ This project adheres to [Semantic Versioning](http://semver.org/). --- +## [2.4.1] - 2018-07-04 + +### Fixed + +- Fix weather parsing issue #1332. + ## [2.4.0] - 2018-07-01 ⚠️ **Warning:** This release includes an updated version of Electron. This requires a Raspberry Pi configuration change to allow the best performance and prevent the CPU from overheating. Please read the information on the [MagicMirror Wiki](https://github.com/michmich/magicmirror/wiki/configuring-the-raspberry-pi#enable-the-open-gl-driver-to-decrease-electrons-cpu-usage). diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index c16759ef..c06f5f5b 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -334,8 +334,15 @@ Module.register("weatherforecast",{ var forecast = data.list[i]; this.parserDataWeather(forecast); // hack issue #1017 - 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"); + var day; + var hour; + if(!!forecast.dt_txt) { + day = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("ddd"); + hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("H"); + } else { + day = moment(forecast.dt, "X").format("ddd"); + hour = moment(forecast.dt, "X").format("H"); + } if (day !== lastDay) { var forecastData = { diff --git a/package-lock.json b/package-lock.json index 8af095a9..6241a3d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.4.0", + "version": "2.4.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 50b46886..b220bee6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.4.0", + "version": "2.4.1", "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": {