From b8ede44a928702b0039c20ef284e15248deba0b7 Mon Sep 17 00:00:00 2001
From: sij <sij@sij.law>
Date: Sat, 8 Feb 2025 01:19:32 +0000
Subject: [PATCH] Update templates/index.html

---
 templates/index.html | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index 7d33c07..6e24f25 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -35,12 +35,15 @@
             const now = new Date();
             const resetTime = new Date();
             
-            // Set to next occurrence of midnight UTC
-            resetTime.setUTCHours(24, 0, 0, 0);
+            // Set to next occurrence of configured reset time
+            resetTime.setUTCHours({{ reset_hour }}, {{ reset_minute }}, 0, 0);
+            if (now > resetTime) {
+                resetTime.setDate(resetTime.getDate() + 1);
+            }
             
             // Calculate when registration should close
             const downtimeStart = new Date(resetTime);
-            downtimeStart.setMinutes(downtimeStart.getMinutes() - 15);
+            downtimeStart.setMinutes(downtimeStart.getMinutes() - {{ downtime_minutes }});
             
             const timeUntilReset = resetTime - now;
             const isRegistrationOpen = now < downtimeStart;