fixed Date query
This commit is contained in:
parent
19d73a37d5
commit
9db5791932
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user