fix: premature week rollover

This commit is contained in:
Sainan 2025-01-12 05:32:17 +01:00
parent 2cd47c8ae2
commit 732061f55a

View File

@ -20,7 +20,7 @@ export const worldStateController: RequestHandler = (req, res) => {
}; };
const day = Math.trunc(new Date().getTime() / 86400000); 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 weekStart = week * 604800000;
const weekEnd = weekStart + 604800000; const weekEnd = weekStart + 604800000;