fixed Date query

This commit is contained in:
Timo Volkmann 2020-07-27 13:52:40 +02:00
parent 19d73a37d5
commit 9db5791932

View File

@ -21,11 +21,15 @@ export default function Overview() {
if (activeDevice === null || activeDevice === undefined) {
return [];
} else {
return SensorDataCollection.find({device_id: activeDevice.deviceId}, {
timestamp: { $gt: moment(Date.now()).subtract(1, 'days').toDate() },
sort: { timestamp: -1 },
//limit: 1440
}).fetch().reverse();
return SensorDataCollection.find(
{
device_id: activeDevice.deviceId,
timestamp: { $gt: moment(Date.now()).subtract(2, 'days').toDate() }
},
{
sort: { timestamp: -1 }
}
).fetch().reverse();
}
});