Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove upcoming events #23080

Merged
merged 3 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions www/src/components/events/__tests__/event-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ describe(`<Events />`, () => {
expect(getByText(`No events are scheduled right now.`)).toBeVisible()
})

it(`splits upcoming and past events`, () => {

it.skip(`splits upcoming and past events`, () => {
const { getByText } = render(
<Events
events={mockEvents(
Expand Down Expand Up @@ -57,7 +58,7 @@ describe(`<Events />`, () => {
dateNowSpy.mockRestore()
})

it(`display's today's events as upcoming`, () => {
it.skip(`display's today's events as upcoming`, () => {
const { getByText } = render(
<Events events={mockEvents([`2100-10-08`].map(toEvent))} />
)
Expand Down
11 changes: 6 additions & 5 deletions www/src/components/events/event-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ import Event from "./event"
export default function EventList({ events }) {
const endOfDay = date => new Date(date).setHours(23, 59, 59, 999)

const upcoming = events.nodes.filter(
event => endOfDay(event.data.date) >= Date.now()
)
// const upcoming = events.nodes.filter(
// event => endOfDay(event.data.date) >= Date.now()
// )

const past = events.nodes
.filter(event => endOfDay(event.data.date) < Date.now())
.reverse()

return events.nodes.length > 0 ? (
<>
<h2>Upcoming Events</h2>
// Temporarily removing during COVID
{/* <h2>Upcoming Events</h2>
<ul>
{upcoming.map(event => (
<li key={event.id}>
<Event event={event.data} />
</li>
))}
</ul>
</ul> */}
<h2>Past Events</h2>
<ul>
{past.map(event => (
Expand Down