Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Added front end sorting for history graph #558

Merged
merged 2 commits into from
Nov 17, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/directives/history-graph/history-graph.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
var desktop = window.innerWidth >= 900 && true;

$scope.promise.then(function(history) {
history.sort(function(lhs, rhs) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does lhs and rhs stand for left and right hand side? Let's use long names in general for JavaScript to eliminate any guessing 😄 Vic and I should be adding a code styleguide soon to the readme, sorry it's taking so long!

lhs = moment(lhs.ratingDate);
rhs = moment(rhs.ratingDate);
return lhs > rhs ? 1 : lhs < rhs ? -1 : 0;
})
$scope.history = history;

var parseDate = d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ").parse;
Expand Down