2
I have this function that takes how many accounts to pay there are and counts how many of them are within the range that I set. But you’re not getting the information right.
$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');
}
}
};
Was any of the answer helpful? Don’t forget to choose one and mark it so it can be used if someone has a similar question!
– Sorack