Skip to content

Conversation

@xaskii
Copy link
Contributor

@xaskii xaskii commented Sep 2, 2025

Before, the furthest out events were being shown on the frontpage. This now shows events on the current day, then upcoming ones.

Time of screenshots: Tue Sep 2, 2025 (url: https://ccss.carleton.ca/)

Before

image

After

image

@xaskii xaskii requested a review from a team as a code owner September 2, 2025 17:14
@xaskii xaskii changed the title Show ongoing, then earliest events in Featured Events section Show ongoing, then earliest events on the front page. Sep 2, 2025
@xaskii xaskii marked this pull request as draft September 2, 2025 17:30
@xaskii xaskii force-pushed the xaskii/latest_featured_events branch from 65ab199 to 8c1be3e Compare September 2, 2025 18:22
@xaskii xaskii changed the title Show ongoing, then earliest events on the front page. Show upcoming, earliest events on the front page. Sep 2, 2025
@xaskii xaskii marked this pull request as ready for review September 2, 2025 18:23
<div class="home-events">
{{ range first 4 (where .Site.RegularPages "Section" "events" ).ByDate.Reverse }}
{{ $today := time.AsTime (now.Format "2006-01-02") }}
{{ range first 4 (where (where .Site.RegularPages "Section" "events") ".Date" "ge" $today).ByDate }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm comparing UTC dates here since we use UTC dates at midnight when defining events.
Example (...Z -> UTC, ...-05:00 -> EST):

title: "Beach Day at Mooney's"
date: 2025-09-07T00:00:01Z
draft: false

@xaskii xaskii changed the title Show upcoming, earliest events on the front page. Show upcoming earliest events on the front page. Sep 2, 2025
@InvalidPathException
Copy link

LGTM

@ryangchung
Copy link
Collaborator

Current main ordering is latest left to right - can you have that same ordering?

@xaskii
Copy link
Contributor Author

xaskii commented Sep 2, 2025

Current main ordering is latest left to right - can you have that same ordering?

Do you prefer the later events being on the left?

Copy link
Collaborator

@ryangchung ryangchung left a comment

Choose a reason for hiding this comment

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

Your change works, thanks for contributing!

@ryangchung ryangchung merged commit 8e2d706 into CarletonComputerScienceSociety:master Sep 2, 2025
2 checks passed
@xaskii xaskii deleted the xaskii/latest_featured_events branch September 2, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants