Replace method to use get with range in paramters.
This commit is contained in:
@ -86,8 +86,15 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
|
||||
|
||||
$scope.getAccountStatus = function(account, month) {
|
||||
if(account != null && month != null) {
|
||||
$http.get("/api/accounts/" + account.id + "/" + month.year + "/" + month.month).
|
||||
success($scope.getAccountStatus_success);
|
||||
// Note: Month is 0 indexed.
|
||||
var begin = moment({year: month.year, month: month.month - 1, day: 1});
|
||||
var end = begin.clone().endOf('month');
|
||||
|
||||
$http.get("/api/accounts/" + account.id,
|
||||
{params: {
|
||||
begin: begin.format('YYYY-MM-DD'),
|
||||
end: end.format('YYYY-MM-DD')
|
||||
}}).success($scope.getAccountStatus_success);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -83,6 +83,8 @@
|
||||
</div>
|
||||
|
||||
{% block footer %}{% endblock %}
|
||||
<script type="text/javascript" src="https://raw.githubusercontent.com/moment/moment/develop/min/moment.min.js"></script>
|
||||
|
||||
<!-- JQuery Javascript library -->
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
|
||||
|
||||
|
Reference in New Issue
Block a user