mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-21 11:09:30 -07:00
fix hourly forecast temperature double-converted
This commit is contained in:
@@ -56,9 +56,6 @@ class Hourly extends WeatherDisplay {
|
|||||||
const list = this.elem.querySelector('.hourly-lines');
|
const list = this.elem.querySelector('.hourly-lines');
|
||||||
list.innerHTML = '';
|
list.innerHTML = '';
|
||||||
|
|
||||||
// get a unit converter
|
|
||||||
const temperatureConverter = temperatureUnit();
|
|
||||||
|
|
||||||
const startingHour = DateTime.local().setZone(timeZone());
|
const startingHour = DateTime.local().setZone(timeZone());
|
||||||
|
|
||||||
const lines = this.data.map((data, index) => {
|
const lines = this.data.map((data, index) => {
|
||||||
@@ -69,8 +66,8 @@ class Hourly extends WeatherDisplay {
|
|||||||
fillValues.hour = formattedHour;
|
fillValues.hour = formattedHour;
|
||||||
|
|
||||||
// temperatures, convert to strings with no decimal
|
// temperatures, convert to strings with no decimal
|
||||||
const temperature = temperatureConverter(data.temperature).toString().padStart(3);
|
const temperature = data.temperature.toString().padStart(3);
|
||||||
const feelsLike = Math.round(data.apparentTemperature).toString().padStart(3);
|
const feelsLike = data.apparentTemperature.toString().padStart(3);
|
||||||
fillValues.temp = temperature;
|
fillValues.temp = temperature;
|
||||||
// only plot apparent temperature if there is a difference
|
// only plot apparent temperature if there is a difference
|
||||||
// if (temperature !== feelsLike) line.querySelector('.like').innerHTML = feelsLike;
|
// if (temperature !== feelsLike) line.querySelector('.like').innerHTML = feelsLike;
|
||||||
|
|||||||
Reference in New Issue
Block a user