From 92032c572acde79ed668cd57255048df542d7b3f Mon Sep 17 00:00:00 2001 From: LithiumNL Date: Sun, 1 Nov 2015 18:27:21 +0100 Subject: [PATCH] Update weather.js The sunset icon was never displayed because the if statement was different. The sunset and sunrise were are in HH:MM and now in another timestamp. _sunset > now should be _sunset > _now --- js/weather/weather.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/weather/weather.js b/js/weather/weather.js index 91134a01..eecd882b 100644 --- a/js/weather/weather.js +++ b/js/weather/weather.js @@ -84,14 +84,14 @@ weather.updateCurrentWeather = function () { $(this.temperatureLocation).updateWithText(_newTempHtml, this.fadeInterval); - var _now = moment(), + var _now = moment().format('HH:mm'), _sunrise = moment(data.sys.sunrise*1000).format('HH:mm'), _sunset = moment(data.sys.sunset*1000).format('HH:mm'); var _newWindHtml = ' ' + this.kmh2Beaufort(_wind), _newSunHtml = ' ' + _sunrise; - if (_sunrise < _now && _sunset > now) { + if (_sunrise < _now && _sunset > _now) { _newSunHtml = ' ' + _sunset; } @@ -165,4 +165,4 @@ weather.init = function () { this.updateWeatherForecast(); }.bind(this), this.updateInterval); -} \ No newline at end of file +}