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

Commit 73c0c62

Browse files
committed
Added front end sorting for history graph
1 parent b477ee4 commit 73c0c62

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/directives/history-graph/history-graph.directive.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
var desktop = window.innerWidth >= 900 && true;
8080

8181
$scope.promise.then(function(history) {
82+
history.sort(function(lhs, rhs) {
83+
lhs = moment(lhs.ratingDate);
84+
rhs = moment(rhs.ratingDate);
85+
return lhs > rhs ? 1 : lhs < rhs ? -1 : 0;
86+
})
8287
$scope.history = history;
8388

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

0 commit comments

Comments
 (0)