diff --git a/CHANGELOG.md b/CHANGELOG.md index 75db4d0c..4212d324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install` ### Changed -- calender week is now handled with a variable translation in order to move number language specific +- Calender week is now handled with a variable translation in order to move number language specific. - Reverted the Electron dependency back to 1.4.15 since newer version don't seem to work on the Raspberry Pi very well. ### Added @@ -21,6 +21,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Add reloadInterval option for particular feed in newsfeed module - Add no-cache entries of HTTP headers in newsfeed module (fetcher) - Add Czech translation. +- Add option for decimal symbols other than the decimal point for temperature values in both default weather modules: WeatherForecast and CurrentWeather. ### Updated diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index c5ba6108..8eb633c0 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -46,6 +46,7 @@ The following properties can be configured: | `onlyTemp` | Show only current Temperature and weather icon.

**Possible values:** `true` or `false`
**Default value:** `false` | `useBeaufort` | Pick between using the Beaufort scale for wind speed or using the default units.

**Possible values:** `true` or `false`
**Default value:** `true` | `lang` | The language of the days.

**Possible values:** `en`, `nl`, `ru`, etc ...
**Default value:** uses value of _config.language_ +| `decimalSymbol` | The decimal symbol to use.

**Possible values:** `.`, `,` or any other symbol.
**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)

**Possible values:** `1000` - `5000`
**Default value:** `0` | `retryDelay` | The delay before retrying after a request failure. (Milliseconds)

**Possible values:** `1000` - `60000`
**Default value:** `2500` | `apiVersion` | The OpenWeatherMap API version to use.

**Default value:** `2.5` diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index f81f62db..8cd3a292 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -24,6 +24,7 @@ Module.register("currentweather",{ showWindDirectionAsArrow: false, useBeaufort: true, lang: config.language, + decimalSymbol: ".", showHumidity: false, degreeLabel: false, showIndoorTemperature: false, @@ -209,9 +210,13 @@ Module.register("currentweather",{ } } + if (this.config.decimalSymbol === "") { + this.config.decimalSymbol = "."; + } + var temperature = document.createElement("span"); temperature.className = "bright"; - temperature.innerHTML = " " + this.temperature + "°" + degreeLabel; + temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel; large.appendChild(temperature); if (this.config.showIndoorTemperature && this.indoorTemperature) { @@ -221,7 +226,7 @@ Module.register("currentweather",{ var indoorTemperatureElem = document.createElement("span"); indoorTemperatureElem.className = "bright"; - indoorTemperatureElem.innerHTML = " " + this.indoorTemperature + "°" + degreeLabel; + indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel; large.appendChild(indoorTemperatureElem); } diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index 3568f7de..ccf81b0f 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -37,6 +37,7 @@ The following properties can be configured: | `updateInterval` | How often does the content needs to be fetched? (Milliseconds)

**Possible values:** `1000` - `86400000`
**Default value:** `600000` (10 minutes) | `animationSpeed` | Speed of the update animation. (Milliseconds)

**Possible values:**`0` - `5000`
**Default value:** `1000` (1 second) | `lang` | The language of the days.

**Possible values:** `en`, `nl`, `ru`, etc ...
**Default value:** uses value of _config.language_ +| `decimalSymbol` | The decimal symbol to use.

**Possible values:** `.`, `,` or any other symbol.
**Default value:** `.` | `fade` | Fade the future events to black. (Gradient)

**Possible values:** `true` or `false`
**Default value:** `true` | `fadePoint` | Where to start fade?

**Possible values:** `0` (top of the list) - `1` (bottom of list)
**Default value:** `0.25` | `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)

**Possible values:** `1000` - `5000`
**Default value:** `2500` (2.5 seconds delay. This delay is used to keep the OpenWeather API happy.) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 56e6a758..8c3a4595 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -21,6 +21,7 @@ Module.register("weatherforecast",{ animationSpeed: 1000, timeFormat: config.timeFormat, lang: config.language, + decimalSymbol: ".", fade: true, fadePoint: 0.25, // Start on 1/4th of the list. colored: false, @@ -155,13 +156,17 @@ Module.register("weatherforecast",{ } } + if (this.config.decimalSymbol === "" || this.config.decimalSymbol === " ") { + this.config.decimalSymbol = "."; + } + var maxTempCell = document.createElement("td"); - maxTempCell.innerHTML = forecast.maxTemp + degreeLabel; + maxTempCell.innerHTML = forecast.maxTemp.replace(".", this.config.decimalSymbol) + degreeLabel; maxTempCell.className = "align-right bright max-temp"; row.appendChild(maxTempCell); var minTempCell = document.createElement("td"); - minTempCell.innerHTML = forecast.minTemp + degreeLabel; + minTempCell.innerHTML = forecast.minTemp.replace(".", this.config.decimalSymbol) + degreeLabel; minTempCell.className = "align-right min-temp"; row.appendChild(minTempCell);