Skip to content

Commit b8f3265

Browse files
author
Scott Straughan
committed
Updated events page to use upcoming events rather than "all".
1 parent ab89665 commit b8f3265

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/app/pages/home/home.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class HomeComponent implements SearchablePage {
136136
this.communityUpdateService.all(6), { initialValue: [] });
137137

138138
this.events = toSignal(
139-
this.eventService.all(4), { initialValue: [] });
139+
this.eventService.getUpcomingEvents(4), { initialValue: [] });
140140

141141
this.yearlyEventCount = toSignal(
142142
this.eventService.getYearlyEventCount(new Date().getFullYear()), { initialValue: 0 } );

src/app/shared/services/models/event.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ export class EventService extends JsonFeedService {
108108
map(events => events.filter((event) => {
109109
return event.starts > currentDateTime ? event : null;
110110
})),
111-
map(events => limit ? events.slice(offset, limit) : events.slice(offset))
111+
map(events => limit ? events.slice(offset, limit) : events.slice(offset)),
112+
map(events => events.sort((a, b) => (a.starts > b.starts) ? 1 : -1))
112113
);
113114
}
114115

0 commit comments

Comments
 (0)