diff --git a/src/components/ExtendedStandingsTable.vue b/src/components/ExtendedStandingsTable.vue index b339408..47d20a3 100644 --- a/src/components/ExtendedStandingsTable.vue +++ b/src/components/ExtendedStandingsTable.vue @@ -23,7 +23,7 @@ - + @@ -96,6 +96,14 @@ export default { }, seasonNumber(): number { return CURRENT_SEASON + }, + getSortedStandings(teamStandings: TeamStanding[]): TeamStanding[] { + if (!teamStandings) return [] + return teamStandings.slice() + .sort((t1, t2) => + (t2.wins - t2.losses) !== (t1.wins - t1.losses) + ? (t2.wins - t2.losses) - (t1.wins - t1.losses) + : (t2.wins + t2.losses) - (t1.wins + t1.losses)) } } }