Skip to content
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
13 changes: 12 additions & 1 deletion src/routes/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,18 @@ const homepageQuery = `{
}`;

function formattingDate(date: Date) {
return date.toISOString().slice(0, 10).replaceAll('-', '/');
const month = date.getMonth() + 1;
const year = date.getFullYear();

if (month >= 1 && month <= 4) {
return `Winter ${year}`;
}

if (month >= 8 && month <= 12) {
return `Fall ${year}`;
}

return 'Closed for the summer';
}

export const load = async ({ url }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
{#if data.ohLastUpdated}
<br />
<span class="text-ecsess-200/70 mb-4 inline-block italic">
Last updated: {data.ohLastUpdated}
Semester: {data.ohLastUpdated}
</span>
{/if}
</p>
Expand Down