Merge pull request #1505 from fwitte/fwitte/change_temperature_unit_display

Remove degree symbol for Kelvin scale
This commit is contained in:
Michael Teeuw 2019-01-03 15:25:24 +01:00 committed by GitHub
commit 675c937a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 10 deletions

View File

@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Updated ### Updated
### Fixed ### Fixed
- Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503).
## [2.6.0] - 2019-01-01 ## [2.6.0] - 2019-01-01

View File

@ -201,13 +201,13 @@ Module.register("currentweather",{
if (this.config.degreeLabel) { if (this.config.degreeLabel) {
switch (this.config.units ) { switch (this.config.units ) {
case "metric": case "metric":
degreeLabel = "C"; degreeLabel = " °C";
break; break;
case "imperial": case "imperial":
degreeLabel = "F"; degreeLabel = " °F";
break; break;
case "default": case "default":
degreeLabel = "K"; degreeLabel = " K";
break; break;
} }
} }
@ -218,7 +218,7 @@ Module.register("currentweather",{
var temperature = document.createElement("span"); var temperature = document.createElement("span");
temperature.className = "bright"; temperature.className = "bright";
temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel; temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + degreeLabel;
large.appendChild(temperature); large.appendChild(temperature);
if (this.config.showIndoorTemperature && this.indoorTemperature) { if (this.config.showIndoorTemperature && this.indoorTemperature) {
@ -228,7 +228,7 @@ Module.register("currentweather",{
var indoorTemperatureElem = document.createElement("span"); var indoorTemperatureElem = document.createElement("span");
indoorTemperatureElem.className = "bright"; indoorTemperatureElem.className = "bright";
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel; indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".", this.config.decimalSymbol) + degreeLabel;
large.appendChild(indoorTemperatureElem); large.appendChild(indoorTemperatureElem);
} }
@ -251,7 +251,7 @@ Module.register("currentweather",{
var feelsLike = document.createElement("span"); var feelsLike = document.createElement("span");
feelsLike.className = "dimmed"; feelsLike.className = "dimmed";
feelsLike.innerHTML = this.translate("FEELS") + " " + this.feelsLike + "°" + degreeLabel; feelsLike.innerHTML = this.translate("FEELS") + " " + this.feelsLike + degreeLabel;
small.appendChild(feelsLike); small.appendChild(feelsLike);
wrapper.appendChild(small); wrapper.appendChild(small);

View File

@ -142,17 +142,17 @@ Module.register("weatherforecast",{
icon.className = "wi weathericon " + forecast.icon; icon.className = "wi weathericon " + forecast.icon;
iconCell.appendChild(icon); iconCell.appendChild(icon);
var degreeLabel = "°"; var degreeLabel = "";
if(this.config.scale) { if(this.config.scale) {
switch(this.config.units) { switch(this.config.units) {
case "metric": case "metric":
degreeLabel += " C"; degreeLabel = " °C";
break; break;
case "imperial": case "imperial":
degreeLabel += " F"; degreeLabel = " °F";
break; break;
case "default": case "default":
degreeLabel = "K"; degreeLabel = " K";
break; break;
} }
} }