Skip to content

Commit 453ec72

Browse files
fix day query bug
1 parent d20451d commit 453ec72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/module-mongodb-storage/src/storage/MongoReportStorage.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ function timeSpan(timeframe: event_types.TimeFrames): mongo.Filter<mongo.Documen
5858
}
5959
default: {
6060
// Start from today to just before tomorrow
61-
const tomorrow = today + 1;
61+
const nextDay = today + 1;
6262
return {
6363
connect_at: {
64-
$gte: new Date(date.getFullYear(), date.getMonth(), today, 0, 0, 0),
65-
$lte: new Date(date.getFullYear(), date.getMonth(), tomorrow, 0, 0, 0)
64+
$gte: new Date(year, month, today, 0, 0, 0),
65+
$lt: new Date(year, month, nextDay, 0, 0, 0)
6666
}
6767
};
6868
}

0 commit comments

Comments
 (0)