Skip to content

Commit

Permalink
Fixed an issue where events are being sliced before being sorted resu…
Browse files Browse the repository at this point in the history
…lting in missing upcoming events.
scottstraughan committed Oct 3, 2024
1 parent d1d5697 commit d95a522
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/app/pages/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -99,6 +99,7 @@ export class HomeComponent implements SearchablePage, OnInit, OnDestroy {

protected readonly Layout = NewsWidgetLayout;
protected readonly CommunityUpdateModelType = ImplementationActivityType;
protected readonly environment = environment;

/**
* Constructor
@@ -217,6 +218,4 @@ export class HomeComponent implements SearchablePage, OnInit, OnDestroy {
getDefaultRoutePath() {
return '/';
}

protected readonly environment = environment;
}
4 changes: 2 additions & 2 deletions src/app/shared/services/models/event.service.ts
Original file line number Diff line number Diff line change
@@ -109,8 +109,8 @@ export class EventService extends JsonFeedService {
map(events => events.filter((event) => {
return event.starts > currentDateTime ? event : null;
})),
map(events => limit ? events.slice(offset, limit) : events.slice(offset)),
map(events => events.sort((a, b) => (a.starts > b.starts) ? 1 : -1))
map(events => events.sort((a, b) => (a.starts > b.starts) ? 1 : -1)),
map(events => limit ? events.slice(offset, limit) : events.slice(offset))
);
}

0 comments on commit d95a522

Please sign in to comment.