Skip to content

Commit

Permalink
fixed prettier issue
Browse files Browse the repository at this point in the history
  • Loading branch information
teguono committed Nov 9, 2023
1 parent c5621fa commit 33543b1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions components/Volunteer/FutureVolunteerEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,21 @@ const FutureVolunteerEvents = () => {
const sortMostRecent = () => {
if (!events) return;
const copy = [...events];
copy.sort((a, b) => new Date(b.startDate).valueOf() - new Date(a.startDate).valueOf());
copy.sort(
(a, b) =>
new Date(b.startDate).valueOf() - new Date(a.startDate).valueOf()
);
setEvents(copy);
};


// Sorts events in order of least to most recent
const sortLeastRecent = () => {
if (!events) return;
const copy = [...events];
copy.sort((a, b) => new Date(a.startDate).valueOf() - new Date(b.startDate).valueOf());
copy.sort(
(a, b) =>
new Date(a.startDate).valueOf() - new Date(b.startDate).valueOf()
);
setEvents(copy);
};

Expand Down Expand Up @@ -140,7 +145,9 @@ const FutureVolunteerEvents = () => {
{/* Container for events that show up based on query input */}
<ImagesWrapper>
{events
.filter(event => event.name.toLowerCase().includes(query.toLowerCase()))
.filter(event =>
event.name.toLowerCase().includes(query.toLowerCase())
)
.map(event => (
<EventCard
key={event._id.toString()}
Expand Down

0 comments on commit 33543b1

Please sign in to comment.