From 0ff400681c9b6f958cee28e53ec969791c70f238 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Wed, 26 Jun 2019 00:45:04 +0200 Subject: [PATCH] fix: stabilize Array.sort --- moment-timezone.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/moment-timezone.js b/moment-timezone.js index faf02ea9..05daed18 100644 --- a/moment-timezone.js +++ b/moment-timezone.js @@ -292,7 +292,10 @@ if (a.abbrScore !== b.abbrScore) { return a.abbrScore - b.abbrScore; } - return b.zone.population - a.zone.population; + if (a.zone.population !== b.zone.population) { + return b.zone.population - a.zone.population; + } + return b.zone.name.localeCompare(a.zone.name); } function addToGuesses (name, offsets) {