LauraMDB commited on
Commit
0edbb4c
·
verified ·
1 Parent(s): 51dbae3

for the course calendar section, make sure the calendar visualization starts on Monday, not Sundat

Browse files
Files changed (1) hide show
  1. script.js +4 -3
script.js CHANGED
@@ -37,9 +37,10 @@ function renderCalendar() {
37
  const firstDay = new Date(currentYear, currentMonth, 1);
38
  const lastDay = new Date(currentYear, currentMonth + 1, 0);
39
  const daysInMonth = lastDay.getDate();
40
- const startingDay = firstDay.getDay();
41
-
42
- // Update month display
 
43
  const monthNames = ['January', 'February', 'March', 'April', 'May', 'June',
44
  'July', 'August', 'September', 'October', 'November', 'December'];
45
  document.getElementById('current-month-display').textContent =
 
37
  const firstDay = new Date(currentYear, currentMonth, 1);
38
  const lastDay = new Date(currentYear, currentMonth + 1, 0);
39
  const daysInMonth = lastDay.getDate();
40
+ let startingDay = firstDay.getDay();
41
+ // Adjust to make Monday (1) the first day of week instead of Sunday (0)
42
+ startingDay = startingDay === 0 ? 6 : startingDay - 1;
43
+ // Update month display
44
  const monthNames = ['January', 'February', 'March', 'April', 'May', 'June',
45
  'July', 'August', 'September', 'October', 'November', 'December'];
46
  document.getElementById('current-month-display').textContent =