Skip to content

Commit

Permalink
filtered events
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-dange committed May 2, 2024
1 parent f1c9107 commit bf8aeeb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pages/store/cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@ const getServerSidePropsFunc: GetServerSideProps = async ({ req, res }) => {
.filter(
event => !(event.orders && event.orderLimit && event.orders.length > event.orderLimit)
)
// filter out events that have a start time less than 2 days from now
.filter(event => {
const startTime = new Date(event.start);
const now = new Date();
now.setDate(now.getDate() + 2);
return startTime >= now;
})
);
const userPromise = getCurrentUserAndRefreshCookie(AUTH_TOKEN, { req, res });

Expand Down

0 comments on commit bf8aeeb

Please sign in to comment.