mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
commit
701a7cae02
@ -140,27 +140,28 @@ Module.register("weatherforecast",{
|
|||||||
icon.className = "wi weathericon " + forecast.icon;
|
icon.className = "wi weathericon " + forecast.icon;
|
||||||
iconCell.appendChild(icon);
|
iconCell.appendChild(icon);
|
||||||
|
|
||||||
|
var degreeLabel = "";
|
||||||
|
if(this.config.scale) {
|
||||||
|
switch(this.config.units) {
|
||||||
|
case "metric":
|
||||||
|
degreeLabel = " °C";
|
||||||
|
break;
|
||||||
|
case "imperial":
|
||||||
|
degreeLabel = " °F";
|
||||||
|
break;
|
||||||
|
case "default":
|
||||||
|
degreeLabel = "K";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var maxTempCell = document.createElement("td");
|
var maxTempCell = document.createElement("td");
|
||||||
maxTempCell.innerHTML = forecast.maxTemp;
|
maxTempCell.innerHTML = forecast.maxTemp + degreeLabel;
|
||||||
if(this.config.scale.toUpperCase() == "C") {
|
|
||||||
maxTempCell.innerHTML += " °C";
|
|
||||||
} else {
|
|
||||||
if(this.config.scale.toUpperCase() == "F") {
|
|
||||||
maxTempCell.innerHTML += " °F";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
maxTempCell.className = "align-right bright max-temp";
|
maxTempCell.className = "align-right bright max-temp";
|
||||||
row.appendChild(maxTempCell);
|
row.appendChild(maxTempCell);
|
||||||
|
|
||||||
var minTempCell = document.createElement("td");
|
var minTempCell = document.createElement("td");
|
||||||
minTempCell.innerHTML = forecast.minTemp;
|
minTempCell.innerHTML = forecast.minTemp + degreeLabel;
|
||||||
if(this.config.scale.toUpperCase() == "C") {
|
|
||||||
minTempCell.innerHTML += " °C";
|
|
||||||
} else {
|
|
||||||
if(this.config.scale.toUpperCase() == "F") {
|
|
||||||
minTempCell.innerHTML += " °F";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
minTempCell.className = "align-right min-temp";
|
minTempCell.className = "align-right min-temp";
|
||||||
row.appendChild(minTempCell);
|
row.appendChild(minTempCell);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user