mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 04:02:12 +00:00
Run automatic fix
This commit is contained in:
parent
e668d488b4
commit
ef8d85773c
@ -10,7 +10,7 @@
|
|||||||
* Copyright 2014, Codrops
|
* Copyright 2014, Codrops
|
||||||
* http://www.codrops.com
|
* http://www.codrops.com
|
||||||
*/
|
*/
|
||||||
;(function(window) {
|
(function(window) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* extend obj function
|
* extend obj function
|
||||||
|
@ -339,7 +339,7 @@ Module.register("weatherforecast",{
|
|||||||
|
|
||||||
var day;
|
var day;
|
||||||
var hour;
|
var hour;
|
||||||
if(!!forecast.dt_txt) {
|
if(forecast.dt_txt) {
|
||||||
day = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("ddd");
|
day = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("ddd");
|
||||||
hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("H");
|
hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("H");
|
||||||
} else {
|
} else {
|
||||||
@ -450,9 +450,9 @@ Module.register("weatherforecast",{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Find all forecasts that is for the same day
|
//Find all forecasts that is for the same day
|
||||||
var checkDateTime = (!!forecast.dt_txt) ? moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss") : moment(forecast.dt, "X");
|
var checkDateTime = (forecast.dt_txt) ? moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss") : moment(forecast.dt, "X");
|
||||||
var daysForecasts = allForecasts.filter(function(item) {
|
var daysForecasts = allForecasts.filter(function(item) {
|
||||||
var itemDateTime = (!!item.dt_txt) ? moment(item.dt_txt, "YYYY-MM-DD hh:mm:ss") : moment(item.dt, "X");
|
var itemDateTime = (item.dt_txt) ? moment(item.dt_txt, "YYYY-MM-DD hh:mm:ss") : moment(item.dt, "X");
|
||||||
return itemDateTime.isSame(checkDateTime, "day") && item.rain instanceof Object;
|
return itemDateTime.isSame(checkDateTime, "day") && item.rain instanceof Object;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user