currentweather, weatherforecast, added option of decimal comma for temperature values to config

This commit is contained in:
Torben Tigges
2017-12-30 22:03:26 +01:00
parent b799609749
commit 46c0e14d67
4 changed files with 28 additions and 4 deletions

View File

@@ -21,6 +21,7 @@ Module.register("weatherforecast",{
animationSpeed: 1000,
timeFormat: config.timeFormat,
lang: config.language,
decimalComma: false,
fade: true,
fadePoint: 0.25, // Start on 1/4th of the list.
colored: false,
@@ -156,12 +157,22 @@ Module.register("weatherforecast",{
}
var maxTempCell = document.createElement("td");
maxTempCell.innerHTML = forecast.maxTemp + degreeLabel;
if (this.config.decimalComma) {
maxTempCell.innerHTML = forecast.maxTemp.replace(".",",") + degreeLabel;
}
else {
maxTempCell.innerHTML = forecast.maxTemp + degreeLabel;
}
maxTempCell.className = "align-right bright max-temp";
row.appendChild(maxTempCell);
var minTempCell = document.createElement("td");
minTempCell.innerHTML = forecast.minTemp + degreeLabel;
if (this.config.decimalComma) {
minTempCell.innerHTML = forecast.minTemp.replace(".",",") + degreeLabel;
}
else {
minTempCell.innerHTML = forecast.minTemp + degreeLabel;
}
minTempCell.className = "align-right min-temp";
row.appendChild(minTempCell);