From 457c80fe769e9bb785315c31b8ce6cb77bc5b867 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 31 May 2020 00:15:54 +0900 Subject: [PATCH 1/4] Correct #2018 Weather forecast need the maxNumberOfDays as argument &cnt=** The minimum is 1 and the maximum is 17. --- modules/default/weatherforecast/weatherforecast.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 8846289e..a04fb40d 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -294,6 +294,8 @@ Module.register("weatherforecast", { return; } + params += "&cnt=" + (((this.config.maxNumberOfDays < 1) || (this.config.maxNumberOfDays > 17)) ? 7 : this.config.maxNumberOfDays); + params += "&units=" + this.config.units; params += "&lang=" + this.config.lang; params += "&APPID=" + this.config.appid; From d306bb25dcbb67375ec485780690613dd210cf51 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 31 May 2020 00:20:42 +0900 Subject: [PATCH 2/4] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78a594e6..0f239f1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ _This release is scheduled to be released on 2020-07-01._ - The broken modules due to Socket.io change from last release [#1973](https://github.com/MichMich/MagicMirror/issues/1973) - Add backward compatibility for old module code in socketclient.js [#1973](https://github.com/MichMich/MagicMirror/issues/1973) +- Fix the use of "maxNumberOfDays" in the module "weatherforecast" [#2018](https://github.com/MichMich/MagicMirror/issues/2018) ## [2.11.0] - 2020-04-01 From 4a7076e01c900d139eaff1d84562417d1b92b0c1 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 31 May 2020 11:46:50 +0900 Subject: [PATCH 3/4] Prettier correction --- modules/default/weatherforecast/weatherforecast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index a04fb40d..4be0582a 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -294,7 +294,7 @@ Module.register("weatherforecast", { return; } - params += "&cnt=" + (((this.config.maxNumberOfDays < 1) || (this.config.maxNumberOfDays > 17)) ? 7 : this.config.maxNumberOfDays); + params += "&cnt=" + (this.config.maxNumberOfDays·<·1·||·this.config.maxNumberOfDays·>·17 ? 7 : this.config.maxNumberOfDays); params += "&units=" + this.config.units; params += "&lang=" + this.config.lang; From cc01c1f0dbc1d9cb6322241a585499b8d6e308ce Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 31 May 2020 11:57:53 +0900 Subject: [PATCH 4/4] Update weatherforecast.js --- modules/default/weatherforecast/weatherforecast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 4be0582a..83389911 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -294,7 +294,7 @@ Module.register("weatherforecast", { return; } - params += "&cnt=" + (this.config.maxNumberOfDays·<·1·||·this.config.maxNumberOfDays·>·17 ? 7 : this.config.maxNumberOfDays); + params += "&cnt=" + (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17 ? 7 : this.config.maxNumberOfDays); params += "&units=" + this.config.units; params += "&lang=" + this.config.lang;