Skip to content
Merged
Changes from 1 commit
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 >= 9 && month <= 12) {
return `Fall ${year}`;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe change this to from August to December instead.

I'm thinking it can be "Semester: Fall {year}" instead of "Last updated: ..."

And get the current month. If month is from May-August, change it to "Closed for the summer"

Let me know if it makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it makes sense.

I've updated according to what you have mentioned.


return `Fall ${year}`;
}

export const load = async ({ url }) => {
Expand Down