diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 103a1d78..120b8bf6 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -203,10 +203,14 @@ Module.register("currentweather",{ var sunset = moment(data.sys.sunset * 1000).format("x"); if (sunrise < now && sunset > now) { - this.sunriseSunsetTime = moment(data.sys.sunset * 1000).format((this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a"); + if (sunrise.isValid()) { + this.sunriseSunsetTime = moment(data.sys.sunset * 1000).format((this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a"); + } this.sunriseSunsetIcon = "wi-sunset"; } else { - this.sunriseSunsetTime = moment(data.sys.sunrise * 1000).format((this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a"); + if (sunset.isValid()) { + this.sunriseSunsetTime = moment(data.sys.sunrise * 1000).format((this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a"); + } this.sunriseSunsetIcon = "wi-sunrise"; }