Skip to content

Commit

Permalink
change5
Browse files Browse the repository at this point in the history
  • Loading branch information
gurramkarthiknetha committed Dec 9, 2024
1 parent c965a31 commit 028856e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/EventCalendar/EventCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,21 @@ const Calendar: React.FC<InterfaceCalendarProps> = ({
holidays?.filter((holiday) => {
try {
return dayjs(holiday.date, 'MM-DD').month() === currentMonth;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
console.error(`Invalid date format for holiday: ${holiday.name}`);
if (e instanceof Error) {
console.error(

Check warning on line 145 in src/components/EventCalendar/EventCalendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventCalendar/EventCalendar.tsx#L145

Added line #L145 was not covered by tests
`Invalid date format for holiday "${holiday.name}":`,
e.message,
);
} else {
console.error(`Unknown error for holiday "${holiday.name}"`);

Check warning on line 150 in src/components/EventCalendar/EventCalendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventCalendar/EventCalendar.tsx#L150

Added line #L150 was not covered by tests
}
return false;

Check warning on line 152 in src/components/EventCalendar/EventCalendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventCalendar/EventCalendar.tsx#L152

Added line #L152 was not covered by tests
}
}),
[holidays, currentMonth],
);

/**
* Moves the calendar view to the next month.
*/
Expand Down

0 comments on commit 028856e

Please sign in to comment.