Skip to content

Commit

Permalink
add the limit days #13
Browse files Browse the repository at this point in the history
  • Loading branch information
xinnix committed Jul 15, 2015
1 parent 349f39f commit 06cc33d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,13 @@ angular.module('members').controller('MembersController', ['$scope', '$http', '$
inventory.$update();

};

//valid date
$scope.availableDays = function(member){
var aDate=new Date(member.active_time).getTime();
var eDate = Date.now();
var availableDays = Math.floor((eDate-aDate)/(24*3600*1000));
return (member.valid_days-availableDays);
};
}
]);
4 changes: 3 additions & 1 deletion public/modules/members/views/list-members.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ <h1>会&nbsp;&nbsp;员</h1>
<span data-ng-bind="member.active_time | date:'yyyy/MM/dd'"></span>&nbsp;&nbsp;&nbsp;&nbsp;

<br/>

availableDays:
<span data-ng-bind=" availableDays(member)"></span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:red;" ng-show="availableDays(member) < 30">Almost Exceed The Time Limit!!!!!!</span>
<br/>
<span ng-hide="member.parent_name.length === 0">家长:{{member.parent_name}}&nbsp;&nbsp;&nbsp;&nbsp;</span>

<span ng-hide="member.phone_number.length === 0">电话:{{member.phone_number}}</span>
Expand Down

0 comments on commit 06cc33d

Please sign in to comment.