Filter members by date functionality added
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="x in members | orderBy: 'last_name'">
|
||||
<tr ng-repeat="x in shown_members | orderBy: 'last_name'">
|
||||
<td>{{ x.last_name }}</td>
|
||||
<td>{{ x.first_name }}</td>
|
||||
<td>{{ x.email }}</td>
|
||||
@@ -33,8 +33,8 @@
|
||||
<td>{{ x.jas }}</td>
|
||||
<td>{{ x.POR }}</td>
|
||||
<td>{{ x.created }}</td>
|
||||
<td>{{ x.paid }}</td>
|
||||
<td>
|
||||
<td>{{ x.paid }}</td>
|
||||
<td>
|
||||
<input type="button" value="Päivitä maksu" class="btn btn-success" ng-click="updatePayment(x.id)" />
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user