Skip to content

Commit

Permalink
fix: improve sorting of events in chat-section AB#14710
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisvisser committed Aug 8, 2022
1 parent 2e7b5e2 commit 4678483
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@ export class ChatComponent implements OnInit, OnDestroy {
private onEventStateChange = (eventState: EventState) => {
this.eventState = eventState;
this.eventState?.events?.sort((a, b) =>
a.startDate > b.startDate ? 1 : -1,
Number(a.firstLeadTime?.split('-')[0]) >
Number(b.firstLeadTime?.split('-')[0])
? 1
: a.startDate > b.startDate
? 1
: -1,
);
};

Expand Down

0 comments on commit 4678483

Please sign in to comment.