diff --git a/components/EventCalendar/Calendar.tsx b/components/EventCalendar/Calendar.tsx index 0926de8..f21b55f 100644 --- a/components/EventCalendar/Calendar.tsx +++ b/components/EventCalendar/Calendar.tsx @@ -11,88 +11,86 @@ const Calendar = () => { let dateToFilter; - const filteredData = calendarData.filter((item) => { + const filteredData = calendarData?.filter((item) => { dateToFilter = new Date(item.date.split("-").reverse().join("-")); return dateToFilter >= new Date(currentDate); }); - // const filteredData = calendarData.filter(()=>{ - - // }) - return ( <> - - - {currDate.getMonth() <= 9 - ? "0" + (currDate.getMonth() + 1) - : currDate.getMonth() + 1} - {"/"} - {currDate.getFullYear()} - - - - - - - - {currDate.toLocaleString("default", { month: "long" })} - - - {filteredData.slice(2, 6).map((event, index) => { - return ( - - - - ); - })} + {filteredData.length > 2 && ( + + + {currDate.getMonth() <= 9 + ? "0" + (currDate.getMonth() + 1) + : currDate.getMonth() + 1} + {"/"} + {currDate.getFullYear()} + + + + - - {filteredData.slice(6, 18).map((event, index) => { - return ( - - + + + {currDate.toLocaleString("default", { month: "long" })} + + + {filteredData.slice(2, 6).map((event, index) => { + return ( + + + + ); + })} - ); - })} - - + + {filteredData.slice(6, 18).map((event, index) => { + return ( + + + + ); + })} + + + )} ); }; diff --git a/components/EventCalendar/EventCalendarData.ts b/components/EventCalendar/EventCalendarData.ts index 6748b5b..9de71b3 100644 --- a/components/EventCalendar/EventCalendarData.ts +++ b/components/EventCalendar/EventCalendarData.ts @@ -475,20 +475,4 @@ export const calendarData: CalendarDataProps[] = [ eventName: "Guess The Picture", icon: triangleIcon, }, - - // do not delete below entry - - //Jan - // { - // date: "26-01-2024", - // eventName: "Republic Day", - // icon: circleIcon, - // }, - - // August - // { - // date: "15-08-2023", - // eventName: "Independence Day", - // icon: circleIcon, - // }, ];