From 1190718023e5e959a53291e07eb5408654a01a48 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Fri, 9 Oct 2015 10:09:22 +0200 Subject: [PATCH] default period always most recent --- public/app/js/controllers/DashboardCtrl.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/app/js/controllers/DashboardCtrl.js b/public/app/js/controllers/DashboardCtrl.js index 82bb33c5..d72a859e 100644 --- a/public/app/js/controllers/DashboardCtrl.js +++ b/public/app/js/controllers/DashboardCtrl.js @@ -211,10 +211,11 @@ app.controller( 'DashboardCtrl', $scope.periods.push( period ); return [ period, parseInt( value.amount ) * multiplicator ]; - } ) }; + } ) + }; } ) .value(); - $scope.periods = _.chain($scope.periods).uniq().reverse().value(); + $scope.periods = _.chain($scope.periods).uniq().sort().reverse().value(); $scope.period = _($scope.periods).first(); } ); };