I have this function that picks up how many payables there are and counts how many of them are within the range that I defined. But it is not bringing the information properly.
$scope.filterDate = function(option)
{
var tam = $scope.billToPayData.length;
if (tam > 0) {
if ($scope.cp.inicio != null && $scope.cp.fim != null) {
for (var i = 0; i < tam; i++) {
$scope.cpFilter[i] = false;
if ($scope.billToPayData[i].vencimento >= $filter('date')($scope.cp.inicio, 'yyyy-MM-dd') &&
$scope.billToPayData[i].vencimento <= $filter('date')($scope.cp.fim, 'yyyy-MM-dd')) {
$scope.cpFilter[i] = true;
}
}
} else {
swal('Selecione as duas datas', 'Digite o período das contas', 'warning');
}
}
};