diff --git a/src/components/svelte/EducationItem.svelte b/src/components/svelte/EducationItem.svelte index fd924bd..7ccfa3f 100644 --- a/src/components/svelte/EducationItem.svelte +++ b/src/components/svelte/EducationItem.svelte @@ -29,9 +29,10 @@ interface Props { entry: EducationEntry + isLast?: boolean } - let { entry }: Props = $props() + let { entry, isLast = false }: Props = $props() const dateDisplay = $derived(() => { const start = entry.startMonth ? `${entry.startMonth} ${entry.startYear}` : `${entry.startYear}` @@ -40,6 +41,18 @@ const end = entry.endMonth ? `${entry.endMonth} ${entry.endYear}` : `${entry.endYear}` return `${start} - ${end}` } + + // Check if start date is in the future + const now = new Date() + const currentYear = now.getFullYear() + const isFutureYear = entry.startYear > currentYear + const isFutureMonth = entry.startYear === currentYear && entry.startMonth && + new Date(`${entry.startMonth} 1, ${entry.startYear}`).getTime() > now.getTime() + + if (isFutureYear || isFutureMonth) { + return `Starting ${start}` + } + if (entry.expected) { return `${start} - Present (Expected)` } @@ -47,9 +60,9 @@ }) -
Core Courses
Awards & Scholarships