scope.routeToTxn = function(){
route.reload();
location.path('/tellers/' + routeParams.tellerId + "/cashiers/" + routeParams.cashierId +"/txns/" + scope.formData.currencyCode);
return function( item, startdate,enddate ) {
var filtered = [];
var txnstartDate = Date.parse(txnstartDate);
var txnendDate = Date.parse(txnendDate);
angular.forEach(item, function(item) {
if(item.completed_date > txnstartDate && item.completed_date < txnendDate) {
filtered.push(item);
}
});
return filtered;
};
};
<td class="col-md-2">
from date:
<input id="startDate" sort type="text" datepicker-pop="dd MMMM yyyy" ng-model="txnstartDate" class="form-control" is-open="opened" min="minDate" max="restrictDate"/>
</td>
<td class="col-md-2">
To date:
<input id="endDate" sort type="text" datepicker-pop="dd MMMM yyyy" ng-model="txnendDate" class="form-control" is-open="opened" min="minDate" max="restrictDate"/>
</td>
<td>
<a ng-click="routeToTxn()" class="btn btn-primary">{{'label.button.cashier.showtxn' | translate}} </a>
</td>
after clicking on search button the data should be filtered via 2 dates :
there are two insert boxes which will take 2 dates starting date and end date and after clicking on search box the data filtered data should be seen