mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 21:00:57 +00:00
Fix JavaScript error in weatherforecast
Change 5568e0c2ad
introduces JavaScript
errors, because it's calling toUpperCase() on a boolean value.
This commit is contained in:
@@ -142,10 +142,10 @@ Module.register("weatherforecast",{
|
|||||||
|
|
||||||
var maxTempCell = document.createElement("td");
|
var maxTempCell = document.createElement("td");
|
||||||
maxTempCell.innerHTML = forecast.maxTemp;
|
maxTempCell.innerHTML = forecast.maxTemp;
|
||||||
if(this.config.scale.toUpperCase() == "C") {
|
if(typeof(this.config.scale) == "string" && this.config.scale.toUpperCase() == "C") {
|
||||||
maxTempCell.innerHTML += " °C";
|
maxTempCell.innerHTML += " °C";
|
||||||
} else {
|
} else {
|
||||||
if(this.config.scale.toUpperCase() == "F") {
|
if(typeof(this.config.scale) == "string" && this.config.scale.toUpperCase() == "F") {
|
||||||
maxTempCell.innerHTML += " °F";
|
maxTempCell.innerHTML += " °F";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -154,10 +154,10 @@ Module.register("weatherforecast",{
|
|||||||
|
|
||||||
var minTempCell = document.createElement("td");
|
var minTempCell = document.createElement("td");
|
||||||
minTempCell.innerHTML = forecast.minTemp;
|
minTempCell.innerHTML = forecast.minTemp;
|
||||||
if(this.config.scale.toUpperCase() == "C") {
|
if(typeof(this.config.scale) == "string" && this.config.scale.toUpperCase() == "C") {
|
||||||
minTempCell.innerHTML += " °C";
|
minTempCell.innerHTML += " °C";
|
||||||
} else {
|
} else {
|
||||||
if(this.config.scale.toUpperCase() == "F") {
|
if(typeof(this.config.scale) == "string" && this.config.scale.toUpperCase() == "F") {
|
||||||
minTempCell.innerHTML += " °F";
|
minTempCell.innerHTML += " °F";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user