From 732061f55a6d099300893b6615c5d68c957ae794 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sun, 12 Jan 2025 05:32:17 +0100 Subject: [PATCH] fix: premature week rollover --- src/controllers/dynamic/worldStateController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/dynamic/worldStateController.ts b/src/controllers/dynamic/worldStateController.ts index a102caf0..5af6734f 100644 --- a/src/controllers/dynamic/worldStateController.ts +++ b/src/controllers/dynamic/worldStateController.ts @@ -20,7 +20,7 @@ export const worldStateController: RequestHandler = (req, res) => { }; const day = Math.trunc(new Date().getTime() / 86400000); - const week = Math.trunc((day + 4) / 7); // week begins on mondays + const week = Math.trunc((day + 3) / 7); // week begins on mondays const weekStart = week * 604800000; const weekEnd = weekStart + 604800000; -- 2.47.2