From 750eaef2ede3477166535174b52552f206dac38b Mon Sep 17 00:00:00 2001 From: TheJoeCoder <joe@radialbog9.uk> Date: Sun, 18 Feb 2024 21:18:42 +0000 Subject: [PATCH] Fix date bug returning double timetables --- bvletools.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bvletools.user.js b/bvletools.user.js index d1ec1a8..f335ac2 100644 --- a/bvletools.user.js +++ b/bvletools.user.js @@ -57,7 +57,7 @@ var now = new Date(); var today = new Date(now.getFullYear(), now.getMonth(), now.getDate()); var lastSunday = new Date(today.setDate(today.getDate()-today.getDay())); - var nextSaturday = new Date(lastSunday).setDate(lastSunday.getDate() + 7); + var nextSaturday = new Date(lastSunday).setDate(lastSunday.getDate() + 6); var url = "https://vle.bromcomcloud.com/Timetable/GetTimeTable?WeekStartDate=" + formatDate(lastSunday) + "&weekEndDate=" + formatDate(nextSaturday) + "&type=1&id=0"; $.ajax({url: url, method: "POST", dataType: "json"}) .done((data) => { -- GitLab