LauraMDB commited on
Commit
51dbae3
verified
1 Parent(s): 44e1e80

for the course calendar section, could you create an actual cakendar view object with some courses as example:

Browse files

[
{
"Course": "OFA400: Atlas Admin",
"Confirmed?": "Yes",
"Start Date": "25-Nov-25",
"End Date": "25-Nov-25",
"Time Zone": "MX CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "LATAM",
"Language": "Spanish",
"Instructor": "Virgilio De la Cruz Jard贸n",
"Event": "MX CST | 2025 Nov 25 | Spanish (OFA400)",
"ID": "c0caf703-35d5-4a9d-a561-5db9cb7d40ee"
},
{
"Course": "OFA500: Atlas API",
"Confirmed?": "Yes",
"Start Date": "26-Nov-25",
"End Date": "26-Nov-25",
"Time Zone": "MX CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "LATAM",
"Language": "Spanish",
"Instructor": "Virgilio De la Cruz Jard贸n",
"Event": "MX CST | 2025 Nov 26 | Spanish (OFA500)",
"ID": "4e805e95-4818-4b11-8dcb-7d77a9bfb016"
},
{
"Course": "DEV400: MongoDB Developer Extension",
"Confirmed?": "Yes",
"Start Date": "27-Nov-25",
"End Date": "27-Nov-25",
"Time Zone": "MX CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "LATAM",
"Language": "Spanish",
"Instructor": "Virgilio De la Cruz Jard贸n",
"Event": "MX CST | 2025 Nov 27 | Spanish (DEV400)",
"ID": "f9a7be49-8f08-48c6-8b17-227ac788fd68"
},
{
"Course": "OA620: Ops Manager Sizing Installation and Configuration (1-day)",
"Confirmed?": "Yes",
"Start Date": "1-Dec-25",
"End Date": "1-Dec-25",
"Time Zone": "FR CET",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "EMEA",
"Language": "French",
"Instructor": "Elie Yaacoub",
"Event": "FR CET | 2025 Dec 01 | French (OA620)",
"ID": "b400dc3c-65ed-4e37-89b4-de67b66f13f0"
},
{
"Course": "OA630: Self-Hosted Security",
"Confirmed?": "Yes",
"Start Date": "01-Dec-25",
"End Date": "01-Dec-25",
"Time Zone": "UK GMT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "NEUR",
"Language": "English",
"Instructor": "Joe Nyirenda",
"Event": "UK GMT | 2025 Dec 01 | English (OA630)",
"ID": "c5eb9db7-8715-40ad-8615-b76b0785b2be"
},
{
"Course": "OFS400: Ops Manager Admin",
"Confirmed?": "Yes",
"Start Date": "2-Dec-25",
"End Date": "2-Dec-25",
"Time Zone": "FR CET",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "EMEA",
"Language": "French",
"Instructor": "Elie Yaacoub",
"Event": "FR CET | 2025 Dec 02 | French (OFS400)",
"ID": "a107c610-fbdc-404e-b95b-497556b3e295"
},
{
"Course": "MDB100: MongoDB Database and Security",
"Confirmed?": "Pending",
"Start Date": "8-Dec-25",
"End Date": "8-Dec-25",
"Time Zone": "US CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "AMER",
"Language": "English",
"Instructor": "Ann Duong",
"Event": "US CST | 2025 Dec 08 | English (MDB100)",
"ID": "ca5d29d0-1924-44b2-bf0d-ee6eb2ed631f"
},
{
"Course": "MDB100: MongoDB Database and Security",
"Confirmed?": "Pending",
"Start Date": "8-Dec-25",
"End Date": "8-Dec-25",
"Time Zone": "SG SGT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "APAC",
"Language": "English",
"Instructor": "Jirachai Chansivanon",
"Event": "SG SGT | 2025 Dec 08 | English (MDB100)",
"ID": "56f03773-aa3f-4246-bc38-e0e50d9b67ec"
},
{
"Course": "MDB100: MongoDB Database and Security",
"Confirmed?": "Pending",
"Start Date": "8-Dec-25",
"End Date": "8-Dec-25",
"Time Zone": "UK GMT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "EMEA",
"Language": "English",
"Instructor": "Joe Nyirenda",
"Event": "UK GMT | 2025 Dec 08 | English (MDB100)",
"ID": "915b651a-fd73-4b6c-8b20-f8a815c85006"
},
{
"Course": "MDB200: MongoDB Optimization and Performance",
"Confirmed?": "Pending",
"Start Date": "9-Dec-25",
"End Date": "9-Dec-25",
"Time Zone": "US CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "AMER",
"Language": "English",
"Instructor": "Ann Duong",
"Event": "US CST | 2025 Dec 09 | English (MDB200)",
"ID": "1d098b3b-229c-47c3-a22c-68dfd5f1ad2b"
},
{
"Course": "MDB200: MongoDB Optimization and Performance",
"Confirmed?": "Pending",
"Start Date": "9-Dec-25",
"End Date": "9-Dec-25",
"Time Zone": "SG SGT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "APAC",
"Language": "English",
"Instructor": "Jirachai Chansivanon",
"Event": "SG SGT | 2025 Dec 09 | English (MDB200)",
"ID": "1df5cf37-e329-434f-a955-cd7866d40fbe"
},
{
"Course": "MDB200: MongoDB Optimization and Performance",
"Confirmed?": "Pending",
"Start Date": "9-Dec-25",
"End Date": "9-Dec-25",
"Time Zone": "UK GMT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "EMEA",
"Language": "English",
"Instructor": "Joe Nyirenda",
"Event": "UK GMT | 2025 Dec 09 | English (MDB200)",
"ID": "87d323f0-d3cc-4e20-966d-f27deea2e0c6"
},
{
"Course": "MDB300: MongoDB Production Readiness",
"Confirmed?": "Pending",
"Start Date": "10-Dec-25",
"End Date": "10-Dec-25",
"Time Zone": "US CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "AMER",
"Language": "English",
"Instructor": "Ann Duong",
"Event": "US CST | 2025 Dec 10 | English (MDB300)",
"ID": "08ad6f17-7a2c-409f-ae45-6b850a2d3e53"
},
{
"Course": "MDB300: MongoDB Production Readiness",
"Confirmed?": "Pending",
"Start Date": "10-Dec-25",
"End Date": "10-Dec-25",
"Time Zone": "SG SGT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "APAC",
"Language": "English",
"Instructor": "Jirachai Chansivanon",
"Event": "SG SGT | 2025 Dec 10 | English (MDB300)",
"ID": "bdc00053-9c45-4d0f-b932-60dfbd42dd86"
},
{
"Course": "MDB300: MongoDB Production Readiness",
"Confirmed?": "Pending",
"Start Date": "10-Dec-25",
"End Date": "10-Dec-25",
"Time Zone": "UK GMT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "EMEA",
"Language": "English",
"Instructor": "Joe Nyirenda",
"Event": "UK GMT | 2025 Dec 10 | English (MDB300)",
"ID": "0280090c-3643-450d-a2a0-e72198edb9ed"
},
{
"Course": "DA630: Distributed Systems and Transactions (1-day)",
"Confirmed?": "Yes",
"Start Date": "10-Dec-25",
"End Date": "10-Dec-25",
"Time Zone": "MX CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "AMER",
"Language": "Spanish",
"Instructor": "Virgilio De la Cruz Jard贸n",
"Event": "MX CST | 2025 Dec 10 | Spanish (DA630)",
"ID": "8acc6ecf-86f8-40e2-816e-abc3b2bd11ee"
},
{
"Course": "DEV400: MongoDB Developer Extension",
"Confirmed?": "Pending",
"Start Date": "11-Dec-25",
"End Date": "11-Dec-25",
"Time Zone": "US CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "AMER",
"Language": "English",
"Instructor": "Ann Duong",
"Event": "US CST | 2025 Dec 11 | English (DEV400)",
"ID": "21a4a4e3-6415-4c54-8257-8139347e2bb0"
},
{
"Course": "DEV400: MongoDB Developer Extension",
"Confirmed?": "Pending",
"Start Date": "11-Dec-25",
"End Date": "11-Dec-25",
"Time Zone": "SG SGT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "APAC",
"Language": "English",
"Instructor": "Jirachai Chansivanon",
"Event": "SG SGT | 2025 Dec 11 | English (DEV400)",
"ID": "af733e7c-8c45-49c9-a543-98539207cf8a"
},
{
"Course": "DEV400: MongoDB Developer Extension",
"Confirmed?": "Pending",
"Start Date": "11-Dec-25",
"End Date": "11-Dec-25",
"Time Zone": "UK GMT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "EMEA",
"Language": "English",
"Instructor": "Joe Nyirenda",
"Event": "UK GMT | 2025 Dec 11 | English (DEV400)",
"ID": "1e40ed5b-a77c-49bd-9545-af956930d4fb"
},
{
"Course": "OA640: Atlas Security",
"Confirmed?": "Yes",
"Start Date": "11-Dec-25",
"End Date": "11-Dec-25",
"Time Zone": "MX CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "AMER",
"Language": "Spanish",
"Instructor": "Virgilio De la Cruz Jard贸n",
"Event": "MX CST | 2025 Dec 11 | Spanish (OA640)",
"ID": "a0eb02fe-bb35-4be8-b1fe-86a1db14c3f9"
},
{
"Course": "OFA400: Atlas Admin",
"Confirmed?": "Pending",
"Start Date": "12-Dec-25",
"End Date": "12-Dec-25",
"Time Zone": "US CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "AMER",
"Language": "English",
"Instructor": "Ann Duong",
"Event": "US CST | 2025 Dec 12 | English (OFA400)",
"ID": "b318921e-9991-4423-942f-16883397221d"
},
{
"Course": "OFA400: Atlas Admin",
"Confirmed?": "Pending",
"Start Date": "12-Dec-25",
"End Date": "12-Dec-25",
"Time Zone": "SG SGT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "APAC",
"Language": "English",
"Instructor": "Jirachai Chansivanon",
"Event": "SG SGT | 2025 Dec 12 | English (OFA400)",
"ID": "566c2101-a91f-43db-9496-bfa671458d6e"
},
{
"Course": "OFA400: Atlas Admin",
"Confirmed?": "Pending",
"Start Date": "12-Dec-25",
"End Date": "12-Dec-25",
"Time Zone": "UK GMT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "EMEA",
"Language": "English",
"Instructor": "Joe Nyirenda",
"Event": "UK GMT | 2025 Dec 12 | English (OFA400)",
"ID": "8cb8d36f-918c-45bb-830a-097e8c44c0b8"
},
{
"Course": "OA610: Benchmarking and Capacity Planning (1-day)",
"Confirmed?": "Pending",
"Start Date": "15-Dec-25",
"End Date": "15-Dec-25",
"Time Zone": "US CST",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "AMER",
"Language": "English",
"Instructor": "Ann Duong",
"Event": "US CST | 2025 Dec 15 | English (OA610)",
"ID": "c8c13309-2a64-4d30-bcb3-5d60db4b53ca"
},
{
"Course": "OA610: Benchmarking and Capacity Planning (1-day)",
"Confirmed?": "Pending",
"Start Date": "15-Dec-25",
"End Date": "15-Dec-25",
"Time Zone": "UK GMT",
"Time": "All Day (9:00 AM - 5:00 PM)",
"Region": "EMEA",
"Language": "English",
"Ins

Files changed (3) hide show
  1. index.html +24 -22
  2. script.js +110 -59
  3. style.css +12 -7
index.html CHANGED
@@ -183,35 +183,37 @@
183
  </div>
184
  </div>
185
  </section>
186
-
187
  <!-- Calendar View Section -->
188
  <section class="mb-20">
189
  <h2 class="text-3xl font-bold text-gray-800 mb-8 text-center">Course Calendar</h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  <div class="bg-white rounded-lg shadow overflow-hidden">
191
- <div class="overflow-x-auto">
192
- <table class="min-w-full divide-y divide-gray-200">
193
- <thead class="bg-gray-50">
194
- <tr>
195
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Course</th>
196
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Confirmed?</th>
197
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Start Date</th>
198
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">End Date</th>
199
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Time Zone</th>
200
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Time</th>
201
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Region</th>
202
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Language</th>
203
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Instructor</th>
204
- </tr>
205
- </thead>
206
- <tbody class="bg-white divide-y divide-gray-200" id="course-calendar">
207
- <!-- Courses will be loaded dynamically -->
208
- </tbody>
209
- </table>
210
  </div>
 
211
  </div>
212
  </section>
213
-
214
- <!-- Upcoming Courses Section -->
215
  <section id="upcoming-courses" class="mb-20">
216
  <h2 class="text-3xl font-bold text-gray-800 mb-8 text-center">Upcoming Courses</h2>
217
 
 
183
  </div>
184
  </div>
185
  </section>
 
186
  <!-- Calendar View Section -->
187
  <section class="mb-20">
188
  <h2 class="text-3xl font-bold text-gray-800 mb-8 text-center">Course Calendar</h2>
189
+ <div class="flex justify-center mb-6">
190
+ <div class="inline-flex rounded-md shadow-sm">
191
+ <button id="prev-month" class="px-4 py-2 text-sm font-medium rounded-l-lg border border-gray-300 hover:bg-gray-50">
192
+ <i data-feather="chevron-left"></i>
193
+ </button>
194
+ <div id="current-month-display" class="px-4 py-2 text-sm font-medium border-t border-b border-gray-300 bg-gray-100">
195
+ November 2025
196
+ </div>
197
+ <button id="next-month" class="px-4 py-2 text-sm font-medium rounded-r-lg border border-gray-300 hover:bg-gray-50">
198
+ <i data-feather="chevron-right"></i>
199
+ </button>
200
+ </div>
201
+ </div>
202
+
203
  <div class="bg-white rounded-lg shadow overflow-hidden">
204
+ <div class="grid grid-cols-7 gap-px bg-gray-200">
205
+ <div class="bg-gray-100 p-2 text-center font-medium text-gray-700">Sun</div>
206
+ <div class="bg-gray-100 p-2 text-center font-medium text-gray-700">Mon</div>
207
+ <div class="bg-gray-100 p-2 text-center font-medium text-gray-700">Tue</div>
208
+ <div class="bg-gray-100 p-2 text-center font-medium text-gray-700">Wed</div>
209
+ <div class="bg-gray-100 p-2 text-center font-medium text-gray-700">Thu</div>
210
+ <div class="bg-gray-100 p-2 text-center font-medium text-gray-700">Fri</div>
211
+ <div class="bg-gray-100 p-2 text-center font-medium text-gray-700">Sat</div>
 
 
 
 
 
 
 
 
 
 
 
212
  </div>
213
+ <div id="calendar-days" class="grid grid-cols-7 gap-px bg-gray-200"></div>
214
  </div>
215
  </section>
216
+ <!-- Upcoming Courses Section -->
 
217
  <section id="upcoming-courses" class="mb-20">
218
  <h2 class="text-3xl font-bold text-gray-800 mb-8 text-center">Upcoming Courses</h2>
219
 
script.js CHANGED
@@ -1,70 +1,121 @@
1
 
2
- // Course data
3
  const coursesData = [
4
- // November 2025
5
- {
6
- course: "OFA400: Atlas Admin",
7
- confirmed: "Yes",
8
- startDate: "25-Nov-25",
9
- endDate: "25-Nov-25",
10
- timeZone: "MX CST",
11
- time: "All Day (9:00 AM - 5:00 PM)",
12
- region: "LATAM",
13
- language: "Spanish",
14
- instructor: "Virgilio De la Cruz Jard贸n",
15
- event: "MX CST | 2025 Nov 25 | Spanish (OFA400)",
16
- id: "c0caf703-35d5-4a9d-a561-5db9cb7d40ee"
17
- },
18
- // Add all other courses from the table here...
19
- // December 2025
20
- {
21
- course: "OFA500: Atlas API",
22
- confirmed: "Yes",
23
- startDate: "26-Nov-25",
24
- endDate: "26-Nov-25",
25
- timeZone: "MX CST",
26
- time: "All Day (9:00 AM - 5:00 PM)",
27
- region: "LATAM",
28
- language: "Spanish",
29
- instructor: "Virgilio De la Cruz Jard贸n",
30
- event: "MX CST | 2025 Nov 26 | Spanish (OFA500)",
31
- id: "4e805e95-4818-4b11-8dcb-7d77a9bfb016"
32
- },
33
- // Add remaining courses...
34
  ];
 
 
 
35
 
36
- // Main JavaScript functionality
37
- document.addEventListener('DOMContentLoaded', async () => {
38
- // Render course calendar
39
- function renderCourseCalendar() {
40
- const calendarBody = document.getElementById('course-calendar');
41
- calendarBody.innerHTML = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
- coursesData.forEach(course => {
44
- const row = document.createElement('tr');
45
- row.className = 'hover:bg-gray-50';
46
- row.innerHTML = `
47
- <td class="px-6 py-4 whitespace-nowrap">
48
- <div class="text-sm font-medium text-gray-900">${course.course}</div>
49
- </td>
50
- <td class="px-6 py-4 whitespace-nowrap">
51
- <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${course.confirmed === 'Yes' ? 'bg-green-100 text-green-800' : 'bg-yellow-100 text-yellow-800'}">
52
- ${course.confirmed}
53
- </span>
54
- </td>
55
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${course.startDate}</td>
56
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${course.endDate}</td>
57
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${course.timeZone}</td>
58
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${course.time}</td>
59
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${course.region}</td>
60
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${course.language}</td>
61
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${course.instructor}</td>
62
- `;
63
- calendarBody.appendChild(row);
64
  });
 
 
65
  }
 
66
 
67
- // Fetch courses from MongoDB API
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  async function fetchCourses() {
69
  try {
70
  const response = await fetch('https://learn.mongodb.com/api/v1/instructor-led-training-schedule');
 
1
 
2
+ // Course data - using the provided JSON
3
  const coursesData = [
4
+ {
5
+ "Course": "OFA400: Atlas Admin",
6
+ "Confirmed?": "Yes",
7
+ "Start Date": "25-Nov-25",
8
+ "End Date": "25-Nov-25",
9
+ "Time Zone": "MX CST",
10
+ "Time": "All Day (9:00 AM - 5:00 PM)",
11
+ "Region": "LATAM",
12
+ "Language": "Spanish",
13
+ "Instructor": "Virgilio De la Cruz Jard贸n",
14
+ "Event": "MX CST | 2025 Nov 25 | Spanish (OFA400)",
15
+ "ID": "c0caf703-35d5-4a9d-a561-5db9cb7d40ee"
16
+ },
17
+ {
18
+ "Course": "OFA500: Atlas API",
19
+ "Confirmed?": "Yes",
20
+ "Start Date": "26-Nov-25",
21
+ "End Date": "26-Nov-25",
22
+ "Time Zone": "MX CST",
23
+ "Time": "All Day (9:00 AM - 5:00 PM)",
24
+ "Region": "LATAM",
25
+ "Language": "Spanish",
26
+ "Instructor": "Virgilio De la Cruz Jard贸n",
27
+ "Event": "MX CST | 2025 Nov 26 | Spanish (OFA500)",
28
+ "ID": "4e805e95-4818-4b11-8dcb-7d77a9bfb016"
29
+ },
30
+ // ... (all other courses from the provided JSON)
 
 
 
31
  ];
32
+ // Calendar functionality
33
+ let currentMonth = new Date().getMonth();
34
+ let currentYear = new Date().getFullYear();
35
 
36
+ 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 =
46
+ `${monthNames[currentMonth]} ${currentYear}`;
47
+
48
+ // Clear previous calendar
49
+ const calendarDays = document.getElementById('calendar-days');
50
+ calendarDays.innerHTML = '';
51
+
52
+ // Add empty cells for days before the first day of month
53
+ for (let i = 0; i < startingDay; i++) {
54
+ const cell = document.createElement('div');
55
+ cell.className = 'bg-white h-24 p-1';
56
+ calendarDays.appendChild(cell);
57
+ }
58
+
59
+ // Add days of month
60
+ for (let day = 1; day <= daysInMonth; day++) {
61
+ const cell = document.createElement('div');
62
+ cell.className = 'bg-white h-24 p-1 overflow-auto';
63
+
64
+ const date = new Date(currentYear, currentMonth, day);
65
+ const dateStr = date.toLocaleDateString('en-US', { day: '2-digit', month: 'short', year: 'numeric' });
66
+
67
+ // Add day number
68
+ const dayNumber = document.createElement('div');
69
+ dayNumber.className = 'font-semibold text-sm mb-1';
70
+ dayNumber.textContent = day;
71
+ cell.appendChild(dayNumber);
72
+
73
+ // Add courses for this day
74
+ const coursesToday = coursesData.filter(course => {
75
+ const courseDate = new Date(course['Start Date']);
76
+ return courseDate.getDate() === day &&
77
+ courseDate.getMonth() === currentMonth &&
78
+ courseDate.getFullYear() === currentYear;
79
+ });
80
 
81
+ coursesToday.forEach(course => {
82
+ const courseEl = document.createElement('div');
83
+ courseEl.className = 'text-xs p-1 mb-1 rounded bg-blue-50 border-l-4 border-blue-500 truncate';
84
+ courseEl.title = `${course.Course}\n${course.Time}\n${course.Instructor}`;
85
+ courseEl.textContent = course.Course;
86
+ cell.appendChild(courseEl);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  });
88
+
89
+ calendarDays.appendChild(cell);
90
  }
91
+ }
92
 
93
+ // Initialize the page
94
+ document.addEventListener('DOMContentLoaded', () => {
95
+ renderCalendar();
96
+
97
+ // Month navigation
98
+ document.getElementById('prev-month').addEventListener('click', () => {
99
+ currentMonth--;
100
+ if (currentMonth < 0) {
101
+ currentMonth = 11;
102
+ currentYear--;
103
+ }
104
+ renderCalendar();
105
+ feather.replace();
106
+ });
107
+
108
+ document.getElementById('next-month').addEventListener('click', () => {
109
+ currentMonth++;
110
+ if (currentMonth > 11) {
111
+ currentMonth = 0;
112
+ currentYear++;
113
+ }
114
+ renderCalendar();
115
+ feather.replace();
116
+ });
117
+ });
118
+ // Fetch courses from MongoDB API
119
  async function fetchCourses() {
120
  try {
121
  const response = await fetch('https://learn.mongodb.com/api/v1/instructor-led-training-schedule');
style.css CHANGED
@@ -9,18 +9,23 @@ body {
9
  .course-path-card:hover {
10
  transform: translateY(-2px);
11
  }
12
-
13
- /* Calendar table styling */
14
- table {
15
- min-width: 1000px;
16
  }
17
- th {
 
18
  background-color: #f8fafc;
19
  }
20
- tr:nth-child(even) {
21
- background-color: #f9fafb;
 
 
22
  }
23
 
 
 
 
24
  /* Animation for course cards */
25
  @keyframes fadeIn {
26
  from { opacity: 0; transform: translateY(20px); }
 
9
  .course-path-card:hover {
10
  transform: translateY(-2px);
11
  }
12
+ /* Calendar styling */
13
+ #calendar-days > div {
14
+ min-height: 6rem;
 
15
  }
16
+
17
+ #calendar-days > div:hover {
18
  background-color: #f8fafc;
19
  }
20
+
21
+ .calendar-course {
22
+ cursor: pointer;
23
+ transition: all 0.2s;
24
  }
25
 
26
+ .calendar-course:hover {
27
+ background-color: #dbeafe;
28
+ }
29
  /* Animation for course cards */
30
  @keyframes fadeIn {
31
  from { opacity: 0; transform: translateY(20px); }