Merge branch 'developer' of s412146/angular-develop-client into master

This commit is contained in:
Dawid Kubicki 2019-01-19 12:27:10 +00:00 committed by Gogs
commit f6210c65ce

View File

@ -53,12 +53,18 @@ export class StatusListComponent implements OnInit {
} else {
newStatus = status.splice(0, i);
}
const first = new Date(newStatus[0].time).getTime();
const last = new Date(newStatus[newStatus.length - 1].time).getTime();
const first = Date.now(); //new Date(newStatus[0].time).getTime();
const last = new Date(newStatus[0].time).getTime(); //new Date(newStatus[newStatus.length - 1].time).getTime();
const time = first - last;
//console.log(this);
this.time = time / 1000;
//console.log(this.time);
if (
this.activeDevice.lastStatus == "0" &&
this.time < 10 &&
newStatus[1].value == "1"
) {
this.activeDevice.lastStatus = "1";
}
console.log(this.time);
});
};