Skip to content

Commit 1332a3a

Browse files
authored
Fixed Rabbit Suggestion
Refactor date handling to avoid modifying original date objects.
1 parent abac281 commit 1332a3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/Components/common/Calendar.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ const DashboardCalendar = () => {
3535
const getTileColor = (d) => {
3636
if (!d) return "bg-transparent";
3737
const date = new Date(year, month, d);
38-
const dayMid = date.setHours(0, 0, 0, 0);
39-
const todayMid = today.setHours(0, 0, 0, 0);
38+
const dayMid = new Date(date).setHours(0, 0, 0, 0);
39+
const todayMid = new Date(today).setHours(0, 0, 0, 0);
4040
const hasEvent = getEventsForDate(date, events).length > 0;
4141
const holiday = getHolidayForDate(date, holidays2025);
4242

0 commit comments

Comments
 (0)