From 5ca0f68b5ffd7b5de17c6450925194beecb40bc7 Mon Sep 17 00:00:00 2001 From: lifeadventurer Date: Mon, 14 Oct 2024 02:03:02 +0800 Subject: [PATCH] Fix: Special event bug --- fortune_generator/js/fortune.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fortune_generator/js/fortune.js b/fortune_generator/js/fortune.js index 9a5a3ef..1bcc1db 100644 --- a/fortune_generator/js/fortune.js +++ b/fortune_generator/js/fortune.js @@ -101,8 +101,8 @@ async function init_page() { $('#date').html(showDate); $('#weekday').html(showDay); - const showSpecialEventCount = 2, eventIndexPtr = 0; - const eventIndexList = Array(showSpecialEventCount).fill(-1); + const showSpecialEventCount = 2; + let eventIndexPtr = 0, eventIndexList = Array(showSpecialEventCount).fill(-1); // check if there is special event today for (let i = 0; i < special_events.length; i++) { if (daysDiff(i) > 0) {