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 20, 2020
1 parent 043d3d5 commit b82473c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions moment-timezone.js
Original file line number Diff line number Diff line change
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 b82473c

Please sign in to comment.