Skip to content

Commit 565ff4a

Browse files
added forced UTC for connection update
1 parent dceadf2 commit 565ff4a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ export class MongoReportStorage implements storage.ReportStorage {
100100
}
101101

102102
private parseJsDate(date: Date) {
103-
const year = date.getFullYear();
104-
const month = date.getMonth();
105-
const today = date.getDate();
106-
const day = date.getDay();
103+
const year = date.getUTCFullYear();
104+
const month = date.getUTCMonth();
105+
const today = date.getUTCDate();
106+
const day = date.getUTCDay();
107107
return {
108108
year,
109109
month,
@@ -169,9 +169,8 @@ export class MongoReportStorage implements storage.ReportStorage {
169169
user_id: userId,
170170
client_id: clientId,
171171
connected_at: {
172-
// Need to create a new date here to sett the time to 00:00:00
173-
$gte: new Date(year, month, today),
174-
$lt: new Date(year, month, nextDay)
172+
$gte: new Date(Date.UTC(year, month, today)),
173+
$lt: new Date(Date.UTC(year, month, nextDay))
175174
}
176175
};
177176
}

0 commit comments

Comments
 (0)