Skip to content

Commit 6e3227e

Browse files
authored
make_schedule_dynamic (#241)
1 parent aaab40b commit 6e3227e

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/static/js/schedule.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,26 @@ document.addEventListener('DOMContentLoaded', () => {
2828
resetCardBackgrounds();
2929
hideAllSchedules();
3030

31-
// Always show FIRST card + its content
32-
const firstCard = cards[2];
31+
const today = new Date();
32+
const day = today.getDate();
33+
const month = today.getMonth();
34+
const year = today.getFullYear();
35+
36+
let date_index = 0;
37+
38+
if (month === 8 && year === 2025) {
39+
if (day <= 12) {
40+
date_index = 0;
41+
} else if (day === 13) {
42+
date_index = 1;
43+
} else if (day === 14) {
44+
date_index = 2;
45+
} else if (day >= 15) {
46+
date_index = 3;
47+
}
48+
}
49+
50+
const firstCard = cards[date_index];
3351
const firstContentId = firstCard.getAttribute('data-schedule');
3452

3553
highlight(firstCard);

0 commit comments

Comments
 (0)