Skip to content

Commit

Permalink
Merge pull request #1505 from fwitte/fwitte/change_temperature_unit_d…
Browse files Browse the repository at this point in the history
…isplay

Remove degree symbol for Kelvin scale
  • Loading branch information
MichMich authored Jan 3, 2019
2 parents b52da7c + c8f53bd commit 675c937
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Updated

### Fixed
- Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503).

## [2.6.0] - 2019-01-01

Expand Down
12 changes: 6 additions & 6 deletions modules/default/currentweather/currentweather.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ Module.register("currentweather",{
if (this.config.degreeLabel) {
switch (this.config.units ) {
case "metric":
degreeLabel = "C";
degreeLabel = " °C";
break;
case "imperial":
degreeLabel = "F";
degreeLabel = " °F";
break;
case "default":
degreeLabel = "K";
degreeLabel = " K";
break;
}
}
Expand All @@ -218,7 +218,7 @@ Module.register("currentweather",{

var temperature = document.createElement("span");
temperature.className = "bright";
temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel;
temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + degreeLabel;
large.appendChild(temperature);

if (this.config.showIndoorTemperature && this.indoorTemperature) {
Expand All @@ -228,7 +228,7 @@ Module.register("currentweather",{

var indoorTemperatureElem = document.createElement("span");
indoorTemperatureElem.className = "bright";
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel;
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".", this.config.decimalSymbol) + degreeLabel;
large.appendChild(indoorTemperatureElem);
}

Expand All @@ -251,7 +251,7 @@ Module.register("currentweather",{

var feelsLike = document.createElement("span");
feelsLike.className = "dimmed";
feelsLike.innerHTML = this.translate("FEELS") + " " + this.feelsLike + "°" + degreeLabel;
feelsLike.innerHTML = this.translate("FEELS") + " " + this.feelsLike + degreeLabel;
small.appendChild(feelsLike);

wrapper.appendChild(small);
Expand Down
8 changes: 4 additions & 4 deletions modules/default/weatherforecast/weatherforecast.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,17 @@ Module.register("weatherforecast",{
icon.className = "wi weathericon " + forecast.icon;
iconCell.appendChild(icon);

var degreeLabel = "°";
var degreeLabel = "";
if(this.config.scale) {
switch(this.config.units) {
case "metric":
degreeLabel += " C";
degreeLabel = " °C";
break;
case "imperial":
degreeLabel += " F";
degreeLabel = " °F";
break;
case "default":
degreeLabel = "K";
degreeLabel = " K";
break;
}
}
Expand Down

0 comments on commit 675c937

Please sign in to comment.