mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +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.
|
||||
- Added `update` in Raspberry Pi installation script.
|
||||
- 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
|
||||
|
||||
|
@ -150,7 +150,11 @@ Module.register("weatherforecast",{
|
||||
if (isNaN(forecast.rain)) {
|
||||
rainCell.innerHTML = "";
|
||||
} 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";
|
||||
row.appendChild(rainCell);
|
||||
|
Loading…
x
Reference in New Issue
Block a user