mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-01 13:33:15 +00:00
possible fix #181
This commit is contained in:
parent
44a6604fe8
commit
9c9e93974e
@ -198,18 +198,18 @@ Module.register("currentweather",{
|
||||
this.windSpeed = this.ms2Beaufort(this.roundValue(data.wind.speed));
|
||||
this.weatherType = this.config.iconTable[data.weather[0].icon];
|
||||
|
||||
var now = moment().format("x");
|
||||
var sunrise = moment(data.sys.sunrise * 1000).format("x");
|
||||
var sunset = moment(data.sys.sunset * 1000).format("x");
|
||||
var now = moment();
|
||||
var sunrise = moment(data.sys.sunrise * 1000);
|
||||
var sunset = moment(data.sys.sunset * 1000);
|
||||
|
||||
if (sunrise < now && sunset > now) {
|
||||
if (sunrise.isValid()) {
|
||||
this.sunriseSunsetTime = moment(data.sys.sunset * 1000).format((this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a");
|
||||
this.sunriseSunsetTime = sunset.format((this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a");
|
||||
}
|
||||
this.sunriseSunsetIcon = "wi-sunset";
|
||||
} else {
|
||||
if (sunset.isValid()) {
|
||||
this.sunriseSunsetTime = moment(data.sys.sunrise * 1000).format((this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a");
|
||||
this.sunriseSunsetTime = sunrise.format((this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a");
|
||||
}
|
||||
this.sunriseSunsetIcon = "wi-sunrise";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user