Fix logic, add section
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
ad38eca98b
commit
6256fe0dcd
|
@ -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";
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue