Skip to content

Commit

Permalink
Merge pull request #280 from mlibrary/WEBSITE-117]-Today-and-Upcoming…
Browse files Browse the repository at this point in the history
…-events-showing-both

Update events-and-exhibits-panel.js
  • Loading branch information
SalazarJosh authored Feb 26, 2024
2 parents 2c6d4d4 + d0ec4ae commit e8176d3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/panels/events-and-exhibits-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export default function EventsAndExhibitsPanel () {
// useEffects are only client side, so we can use now here.

// Get upcoming events.
// This is repetative... but :shrug:
const upcomingEvents = events.filter((event) => {
const start = new Date(event.field_event_date_s_[0].value);
const type = event.relationships.field_event_type.name;
Expand All @@ -101,7 +100,7 @@ export default function EventsAndExhibitsPanel () {
if (EXHIBIT_TYPES.includes(type)) {
return false;
}
return now < start; // all after today.
return now < new Date(start.toDateString()); // all after today.
});

setUpcomingEvents(upcomingEvents);
Expand Down

0 comments on commit e8176d3

Please sign in to comment.