diff --git a/members/static/html/jasenlista.html b/members/static/html/jasenlista.html index 54b45c1..091ad93 100644 --- a/members/static/html/jasenlista.html +++ b/members/static/html/jasenlista.html @@ -25,7 +25,7 @@ - + {{ x.last_name }} {{ x.first_name }} {{ x.email }} @@ -33,8 +33,8 @@ {{ x.jas }} {{ x.POR }} {{ x.created }} - {{ x.paid }} - + {{ x.paid }} + diff --git a/members/static/js/members_controllers.js b/members/static/js/members_controllers.js index 79b9b72..46c5a82 100644 --- a/members/static/js/members_controllers.js +++ b/members/static/js/members_controllers.js @@ -75,6 +75,7 @@ app.controller("getController", function($scope, $http, $window, $location){ m.jas = m.jas ? "Kyllä" : "Ei"; m.AYY = m.AYY ? "Kyllä" : "Ei"; }); + $scope.shown_members = $scope.members; }); }; $scope.getFunction(); @@ -103,11 +104,18 @@ app.controller("getController", function($scope, $http, $window, $location){ $scope.filter_by_date = function() { if ($scope.datePicker == null) { - + $scope.shown_members = $scope.members; } else { - + $scope.shown_members = []; + for (var i = 0; i < $scope.members.length; i++) + { + if (moment($scope.members[i].paid) < $scope.datePicker) + { + $scope.shown_members.push($scope.members[i]); + } + } } }; $scope.clear_filter = function() {