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 all commits
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(left, right) {
left = moment(left.ratingDate);
right = moment(right.ratingDate);
return left > right ? 1 : left < right ? -1 : 0;
})
$scope.history = history;

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