From 9db5791932d9b9221ca6885e83ca412836cb9e26 Mon Sep 17 00:00:00 2001 From: Timo Volkmann Date: Mon, 27 Jul 2020 13:52:40 +0200 Subject: [PATCH] fixed Date query --- imports/ui/Overview.jsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/imports/ui/Overview.jsx b/imports/ui/Overview.jsx index 950ad93..924bc92 100644 --- a/imports/ui/Overview.jsx +++ b/imports/ui/Overview.jsx @@ -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(); } });