From 32e84681264eeebee8b9baafd302e6e526c55b1d Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 28 Sep 2024 06:21:25 +0100 Subject: [PATCH] now?!?!? --- src/common/schema/player-schema.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/schema/player-schema.ts b/src/common/schema/player-schema.ts index 4835229..310f724 100644 --- a/src/common/schema/player-schema.ts +++ b/src/common/schema/player-schema.ts @@ -70,7 +70,7 @@ PlayerSchema.methods.getLastTracked = function (): Date { PlayerSchema.methods.getHistory = function (date: Date): PlayerHistory { return ( - this.statisticHistory.get(getMidnightAlignedDate(date).toString()) || {} + this.statisticHistory.get(getMidnightAlignedDate(date).toUTCString()) || {} ); }; @@ -91,7 +91,7 @@ PlayerSchema.methods.setStatisticHistory = function ( if (!this.statisticHistory) { this.statisticHistory = new Map(); } - const alignedDate = getMidnightAlignedDate(date).toString(); + const alignedDate = getMidnightAlignedDate(date).toUTCString(); return this.statisticHistory.set(alignedDate, data); }; @@ -111,7 +111,7 @@ PlayerSchema.methods.sortStatisticHistory = function (): Map< Date.parse(b[0]) - Date.parse(a[0]), ) // Convert the date strings back to Date objects for the resulting Map - .map(([date, history]) => [new Date(date).toString(), history]), + .map(([date, history]) => [new Date(date).toUTCString(), history]), ); return this.statisticHistory; };