Skip to content

Commit

Permalink
Merge pull request #16 from codeplaysoftware/tweaked-event-listings
Browse files Browse the repository at this point in the history
Tweaked Event Listing Ordering
  • Loading branch information
scottstraughan authored Jul 26, 2024
2 parents fc2a4fc + b8f3265 commit af43c78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/pages/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class HomeComponent implements SearchablePage {
this.communityUpdateService.all(6), { initialValue: [] });

this.events = toSignal(
this.eventService.all(4), { initialValue: [] });
this.eventService.getUpcomingEvents(4), { initialValue: [] });

this.yearlyEventCount = toSignal(
this.eventService.getYearlyEventCount(new Date().getFullYear()), { initialValue: 0 } );
Expand All @@ -155,7 +155,7 @@ export class HomeComponent implements SearchablePage {
{ initialValue: PlaygroundSampleService.getDefaultSample() });

this.projectCount = toSignal(
this.eventService.count(), { initialValue: 0 });
this.projectService.count(), { initialValue: 0 });

this.videoCount = toSignal(
this.videoService.count(), { initialValue: 0 });
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/services/models/event.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,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 => limit ? events.slice(offset, limit) : events.slice(offset)),
map(events => events.sort((a, b) => (a.starts > b.starts) ? 1 : -1))
);
}

Expand Down

0 comments on commit af43c78

Please sign in to comment.