mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Show correct units for showRainAmount
This commit is contained in:
parent
865dce6f68
commit
a4cb53fdb4
@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Remove white flash on boot up.
|
- Remove white flash on boot up.
|
||||||
- Added `update` in Raspberry Pi installation script.
|
- Added `update` in Raspberry Pi installation script.
|
||||||
- Fix an issue where the analog clock looked scrambled. ([#611](https://github.com/MichMich/MagicMirror/issues/611))
|
- Fix an issue where the analog clock looked scrambled. ([#611](https://github.com/MichMich/MagicMirror/issues/611))
|
||||||
|
- If units is set to imperial, the showRainAmount option of weatherforecast will show the correct unit.
|
||||||
|
|
||||||
## [2.1.0] - 2016-12-31
|
## [2.1.0] - 2016-12-31
|
||||||
|
|
||||||
|
@ -150,7 +150,11 @@ Module.register("weatherforecast",{
|
|||||||
if (isNaN(forecast.rain)) {
|
if (isNaN(forecast.rain)) {
|
||||||
rainCell.innerHTML = "";
|
rainCell.innerHTML = "";
|
||||||
} else {
|
} else {
|
||||||
rainCell.innerHTML = forecast.rain + " mm";
|
if(config.units !== "imperial") {
|
||||||
|
rainCell.innerHTML = forecast.rain + " mm";
|
||||||
|
} else {
|
||||||
|
rainCell.innerHTML = (parseFloat(forecast.rain) / 25.4).toFixed(2) + " in";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rainCell.className = "align-right bright rain";
|
rainCell.className = "align-right bright rain";
|
||||||
row.appendChild(rainCell);
|
row.appendChild(rainCell);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user