Skip to content

Commit

Permalink
Order zones by name
Browse files Browse the repository at this point in the history
  • Loading branch information
ellenaua committed Feb 21, 2020
1 parent 5c5e434 commit 2fd579e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions moment-timezone.js
Expand Up @@ -507,16 +507,17 @@
country = getCountry(country);

if (country) {
var zones = country.zones.sort();
if (with_offset) {
return country.zones.map(function (zone_name) {
return zones.map(function (zone_name) {
var zone = getZone(zone_name);
return {
name: zone_name,
offset: zone.utcOffset(new Date())
};
});
} else {
return country.zones;
return zones;
}
}

Expand Down

0 comments on commit 2fd579e

Please sign in to comment.