Skip to content
Merged
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
9 changes: 6 additions & 3 deletions sites/www/lib/src/pages/events_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,24 @@ class EventsPage extends StatelessComponent {
CalendarEvent.fromJson,
);

final now = DateTime.now().toUtc();
// Events currently only have a start date,
// so keep them listed for a few extra days to
// cover multi-day events that might still be ongoing or
// events that recently ended and are potentially still relevant.
const visibleAfterDays = 3;
final now = DateTime.now().toUtc();
final cutoff = DateTime.utc(now.year, now.month, now.day - visibleAfterDays);
final cutoff = DateTime.utc(
now.year,
now.month,
now.day - visibleAfterDays,
);
final events = rawEvents
.where(
(event) => !DateTime.utc(
event.date.year,
event.date.month,
event.date.day,
).isBefore(today),
).isBefore(cutoff),
)
.toList(growable: false);

Expand Down
Loading