Skip to content

Commit

Permalink
Slightly improve relativeText verb tense for ended events
Browse files Browse the repository at this point in the history
  • Loading branch information
Xevion committed Feb 2, 2023
1 parent cf172b7 commit b9c3681
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/pages/events/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,9 @@ const EventView: NextPage<{ json: string }> = ({ json }) => {
);

const now = new Date();
const relativeText = `${isPast(event.eventStart) ? "ends " : ""}${formatRelative(
!isPast(event.eventStart) ? event.eventStart : event.eventEnd,
now
)}`;
const relativeText = `${
isPast(event.eventStart) ? (isPast(event.eventEnd) ? "ended " : "ends ") : ""
}${formatRelative(!isPast(event.eventStart) ? event.eventStart : event.eventEnd, now)}`;

const checkinOpen = isCheckinOpen(event);
return (
Expand Down Expand Up @@ -335,7 +334,7 @@ export async function getStaticProps({
}

export async function getStaticPaths() {
return { paths: [], fallback: "blocking" };
return {paths: [], fallback: "blocking"};
}

export default EventView;

0 comments on commit b9c3681

Please sign in to comment.