Fix logic, add section
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jared He 2021-08-31 21:59:24 -05:00
parent ad38eca98b
commit 6256fe0dcd
2 changed files with 20 additions and 20 deletions

View File

@ -191,11 +191,11 @@ export function getCurrentTerm(): { year: string; term: string } {
term = "winter";
} else if (
new Date(`${year}-05-01 EST`).getTime() <= date.getTime() &&
date.getTime() <= new Date(`${year}-08-31 EST`).getTime()
date.getTime() <= new Date(`${year}-09-02 EST`).getTime()
) {
term = "spring";
} else if (
new Date(`${year}-09-01 EST`).getTime() <= date.getTime() &&
new Date(`${year}-09-03 EST`).getTime() <= date.getTime() &&
date.getTime() <= new Date(`${year}-12-31 EST`).getTime()
) {
term = "fall";

View File

@ -99,22 +99,13 @@ export default function Term(props: Props) {
</section>
)}
{hasPastEvents && !props.isCurrentTerm && (
<section>
<h1>
Events Archive:
<span className={styles.blue}>
{` ${capitalize(props.term)} ${props.year}`}
</span>
</h1>
)}
{!hasFutureEvents && !hasPastEvents && (
<>
<h1>Events</h1>
There are no upcoming or past events for the{" "}
{`${capitalize(props.term)} ${props.year}`} term. Please check back
later!
</>
)}
{!hasPastEvents && !props.isCurrentTerm && (
<div className={styles.miniEventCards}>
{props.pastEvents.map(({ content, metadata }) => (
<MiniEventCard
@ -125,6 +116,15 @@ export default function Term(props: Props) {
/>
))}
</div>
</section>
)}
{!hasFutureEvents && !hasPastEvents && (
<>
<h1>Events</h1>
There are no upcoming or past events for the{" "}
{`${capitalize(props.term)} ${props.year}`} term. Please check back
later!
</>
)}
</div>
);