Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
FIX: hours offset calculation, secondary sort by username
Browse files Browse the repository at this point in the history
  • Loading branch information
merefield committed Dec 22, 2019
1 parent 989c42c commit 01a24ab
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions assets/javascripts/discourse/components/team-display.js.es6
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ export default Ember.Component.extend({

people.forEach (a => {
let timezone = a.timezone.timezone;
a.offset = moment.tz(timezone)._offset;
a.offset = Math.round((moment.tz(timezone)._offset)/60);
});

people.sort(
(a, b) => ((times_score(a.offset,n) < times_score(b.offset,n)) ? 1 : -1)
people.sort(
(a, b) => ((a.username_lower > b.username_lower) ? 1 : -1)
);

people.sort(
(a, b) => ((times_score(a.offset,n) < times_score(b.offset,n)) ? 1 : -1)
);

return people;
},
Expand Down

0 comments on commit 01a24ab

Please sign in to comment.