From 0893005c8ac74ae3f2b40c6a7f8a014585f4da9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isac=20=C3=85str=C3=B6m?= Date: Thu, 7 Nov 2024 21:11:46 +0100 Subject: [PATCH] Maybe fix? (II) --- client/scripts/dashboard.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/scripts/dashboard.js b/client/scripts/dashboard.js index 7e36339..da2dcfb 100644 --- a/client/scripts/dashboard.js +++ b/client/scripts/dashboard.js @@ -80,14 +80,14 @@ Template.dashboard.events({ date.setDate(date.getDate() + 1); obj.expire = date; } else { - let nextFourAM = new Date(); - nextFourAM.setHours(4, 0, 0, 0); // Set time to 04:00:00.000 + let exp = new Date(); + exp.setHours(4, 0, 0, 0); // Set time to 04:00:00.000 // If 04:00 has already passed today, set it for tomorrow - if (new Date() >= nextFourAM) { - nextFourAM.setDate(nextFourAM.getDate() + 1); + if (new Date() >= exp) { + exp.setDate(exp.getDate() + 1); } - obj.expire = nextFourAM; + obj.expire = exp; } // I wish I had a date :'( var report = function(success, identifier) {