mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
currentweather, weatherforecast, changed option of decimal comma to any decimal symbol
This commit is contained in:
@@ -46,7 +46,7 @@ The following properties can be configured:
|
||||
| `onlyTemp` | Show only current Temperature and weather icon. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||
| `useBeaufort` | Pick between using the Beaufort scale for wind speed or using the default units. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||
| `lang` | The language of the days. <br><br> **Possible values:** `en`, `nl`, `ru`, etc ... <br> **Default value:** uses value of _config.language_
|
||||
| `decimalComma` | Whether or not to show a decimal comma instead of a decimal point for temperature values.<br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||
| `decimalSymbol` | The decimal symbol to use.<br><br> **Possible values:** `.`, `,` or any other symbol.<br> **Default value:** `.`
|
||||
| `initialLoadDelay` | The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds) <br><br> **Possible values:** `1000` - `5000` <br> **Default value:** `0`
|
||||
| `retryDelay` | The delay before retrying after a request failure. (Milliseconds) <br><br> **Possible values:** `1000` - `60000` <br> **Default value:** `2500`
|
||||
| `apiVersion` | The OpenWeatherMap API version to use. <br><br> **Default value:** `2.5`
|
||||
|
@@ -24,7 +24,7 @@ Module.register("currentweather",{
|
||||
showWindDirectionAsArrow: false,
|
||||
useBeaufort: true,
|
||||
lang: config.language,
|
||||
decimalComma: false,
|
||||
decimalSymbol: ".",
|
||||
showHumidity: false,
|
||||
degreeLabel: false,
|
||||
showIndoorTemperature: false,
|
||||
@@ -210,14 +210,13 @@ Module.register("currentweather",{
|
||||
}
|
||||
}
|
||||
|
||||
if (this.config.decimalSymbol === "") {
|
||||
this.config.decimalSymbol = ".";
|
||||
}
|
||||
|
||||
var temperature = document.createElement("span");
|
||||
temperature.className = "bright";
|
||||
if (this.config.decimalComma) {
|
||||
temperature.innerHTML = " " + this.temperature.replace(".",",") + "°" + degreeLabel;
|
||||
}
|
||||
else {
|
||||
temperature.innerHTML = " " + this.temperature + "°" + degreeLabel;
|
||||
}
|
||||
temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel;
|
||||
large.appendChild(temperature);
|
||||
|
||||
if (this.config.showIndoorTemperature && this.indoorTemperature) {
|
||||
@@ -227,12 +226,7 @@ Module.register("currentweather",{
|
||||
|
||||
var indoorTemperatureElem = document.createElement("span");
|
||||
indoorTemperatureElem.className = "bright";
|
||||
if (this.config.decimalComma) {
|
||||
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".",",") + "°" + degreeLabel;
|
||||
}
|
||||
else {
|
||||
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature + "°" + degreeLabel;
|
||||
}
|
||||
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel;
|
||||
large.appendChild(indoorTemperatureElem);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user