Skip to content

Commit

Permalink
fixed date filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
lovretomic committed Feb 7, 2025
1 parent 25d6f49 commit 36a0094
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions apps/app/src/pages/SchedulePage/SchedulePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ export const SchedulePage = () => {
useEffect(() => {
const dateFilter = new Date(
activeTab === TabId.FIRST_DAY ? '2025-05-23' : '2025-05-24',
);
).toDateString();

setFilteredEvents(
events.filter(
(event) =>
(new Date(event.startsAt).getDate() === dateFilter.getDate() &&
event.theme === activeTag.toUpperCase()) ||
activeTag === TagId.ALL,
),
events.filter((event) => {
const eventDate = new Date(event.startsAt).toDateString();
return (
eventDate === dateFilter &&
(activeTag === TagId.ALL ||
event.theme.toUpperCase() === activeTag.toUpperCase())
);
}),
);
}, [activeTab, activeTag]);

Expand Down

0 comments on commit 36a0094

Please sign in to comment.