Spaces:
Running
Running
for the course calendar section, make sure the calendar visualization starts on Monday, not Sundat
Browse files
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 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
| 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 =
|