Skip to content

Commit 6aa156d

Browse files
authored
Merge pull request #1343 from MichMich/develop
Release 2.4.1
2 parents 3545f80 + ef5ea93 commit 6aa156d

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55

66
---
77

8+
## [2.4.1] - 2018-07-04
9+
10+
### Fixed
11+
12+
- Fix weather parsing issue #1332.
13+
814
## [2.4.0] - 2018-07-01
915

1016
⚠️ **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).

modules/default/weatherforecast/weatherforecast.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,15 @@ Module.register("weatherforecast",{
334334
var forecast = data.list[i];
335335
this.parserDataWeather(forecast); // hack issue #1017
336336

337-
var day = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("ddd");
338-
var hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("H");
337+
var day;
338+
var hour;
339+
if(!!forecast.dt_txt) {
340+
day = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("ddd");
341+
hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("H");
342+
} else {
343+
day = moment(forecast.dt, "X").format("ddd");
344+
hour = moment(forecast.dt, "X").format("H");
345+
}
339346

340347
if (day !== lastDay) {
341348
var forecastData = {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "magicmirror",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "The open source modular smart mirror platform.",
55
"main": "js/electron.js",
66
"scripts": {

0 commit comments

Comments
 (0)