Skip to content

Commit 5d85d94

Browse files
Fix calendar dates and community.js syntax error
Co-authored-by: NekshaDeSilva <102156620+NekshaDeSilva@users.noreply.github.com>
1 parent d6ef55e commit 5d85d94

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

scripts/calendar.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,22 @@ document.addEventListener('DOMContentLoaded', function() {
2424
const closeEventModal = document.getElementById('closeEventModal');
2525
const eventForm = document.getElementById('eventForm');
2626

27-
// Sample events data
27+
// Sample events data - using relative dates from today
28+
const today = new Date();
29+
const getDateOffset = (daysOffset) => {
30+
const date = new Date(today);
31+
date.setDate(today.getDate() + daysOffset);
32+
return date;
33+
};
34+
2835
const sampleEvents = [
2936
{
3037
id: 1,
3138
title: 'Advanced React Patterns',
3239
type: 'lecture',
3340
instructor: 'Sarah Chen',
3441
time: '10:00 AM - 11:30 AM',
35-
date: new Date(2024, 11, 23),
42+
date: getDateOffset(0),
3643
description: 'Deep dive into advanced React patterns including HOCs, render props, and custom hooks.',
3744
attendees: 45,
3845
maxAttendees: 50,
@@ -44,7 +51,7 @@ document.addEventListener('DOMContentLoaded', function() {
4451
type: 'workshop',
4552
instructor: 'Mike Johnson',
4653
time: '2:00 PM - 4:00 PM',
47-
date: new Date(2024, 11, 23),
54+
date: getDateOffset(0),
4855
description: 'Hands-on workshop covering lists, dictionaries, sets, and tuples in Python.',
4956
attendees: 32,
5057
maxAttendees: 40,
@@ -56,7 +63,7 @@ document.addEventListener('DOMContentLoaded', function() {
5663
type: 'lecture',
5764
instructor: 'Alex Rodriguez',
5865
time: '11:00 AM - 12:30 PM',
59-
date: new Date(2024, 11, 24),
66+
date: getDateOffset(1),
6067
description: 'Optimization techniques for Node.js applications including clustering and caching.',
6168
attendees: 28,
6269
maxAttendees: 35,
@@ -68,7 +75,7 @@ document.addEventListener('DOMContentLoaded', function() {
6875
type: 'workshop',
6976
instructor: 'Emma Davis',
7077
time: '1:00 PM - 3:30 PM',
71-
date: new Date(2024, 11, 25),
78+
date: getDateOffset(2),
7279
description: 'Complete guide to CSS Grid layout with practical examples and exercises.',
7380
attendees: 38,
7481
maxAttendees: 45,
@@ -80,7 +87,7 @@ document.addEventListener('DOMContentLoaded', function() {
8087
type: 'lecture',
8188
instructor: 'Dr. James Wilson',
8289
time: '9:00 AM - 10:30 AM',
83-
date: new Date(2024, 11, 26),
90+
date: getDateOffset(3),
8491
description: 'Fundamental principles of database design, normalization, and optimization.',
8592
attendees: 52,
8693
maxAttendees: 60,

scripts/community.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ class CommunityManager {
7474
this.socket.on('stop-typing', (data) => {
7575
this.hideTypingIndicator(data);
7676
});
77-
}
78-
}
7977

8078
// Real-time message handlers
8179
this.socket.on('new-message', (message) => {

0 commit comments

Comments
 (0)