Skip to content

Commit

Permalink
remove CodeRabbit's code suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
aeworxet committed Nov 13, 2024
1 parent 2677a18 commit f4cf284
Show file tree
Hide file tree
Showing 3 changed files with 579 additions and 575 deletions.
11 changes: 5 additions & 6 deletions components/Calendar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isAfter, parseISO } from 'date-fns';
import moment from 'moment';
import React, { useMemo } from 'react';
import React from 'react';
import { twMerge } from 'tailwind-merge';

import type { IEvent } from '@/types/event';
Expand Down Expand Up @@ -30,10 +29,10 @@ export default function Calendar({ className = '', size }: ICalendarProps) {
const CALENDAR_URL =
'https://calendar.google.com/calendar/embed?src=c_q9tseiglomdsj6njuhvbpts11c%40group.calendar.google.com&ctz=UTC';
const currentDate = new Date();
const eventsExist = useMemo(
() => eventsData?.some((event: IEvent) => isAfter(parseISO(event.date), currentDate)),
[currentDate]
);
const eventsExist =
eventsData?.filter((event: IEvent) =>
moment(event.date).isAfter(currentDate),
).length > 0;

return (
<div
Expand Down
Loading

0 comments on commit f4cf284

Please sign in to comment.