mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 04:45:17 +00:00
currentweather, weatherforecast, added option of decimal comma for temperature values to config
This commit is contained in:
@@ -24,6 +24,7 @@ Module.register("currentweather",{
|
||||
showWindDirectionAsArrow: false,
|
||||
useBeaufort: true,
|
||||
lang: config.language,
|
||||
decimalComma: false,
|
||||
showHumidity: false,
|
||||
degreeLabel: false,
|
||||
showIndoorTemperature: false,
|
||||
@@ -211,7 +212,12 @@ Module.register("currentweather",{
|
||||
|
||||
var temperature = document.createElement("span");
|
||||
temperature.className = "bright";
|
||||
temperature.innerHTML = " " + this.temperature + "°" + degreeLabel;
|
||||
if (this.config.decimalComma) {
|
||||
temperature.innerHTML = " " + this.temperature.replace(".",",") + "°" + degreeLabel;
|
||||
}
|
||||
else {
|
||||
temperature.innerHTML = " " + this.temperature + "°" + degreeLabel;
|
||||
}
|
||||
large.appendChild(temperature);
|
||||
|
||||
if (this.config.showIndoorTemperature && this.indoorTemperature) {
|
||||
@@ -221,7 +227,12 @@ Module.register("currentweather",{
|
||||
|
||||
var indoorTemperatureElem = document.createElement("span");
|
||||
indoorTemperatureElem.className = "bright";
|
||||
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature + "°" + degreeLabel;
|
||||
if (this.config.decimalComma) {
|
||||
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".",",") + "°" + degreeLabel;
|
||||
}
|
||||
else {
|
||||
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature + "°" + degreeLabel;
|
||||
}
|
||||
large.appendChild(indoorTemperatureElem);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user