I have a listing with date range filter for which I'm using ng-table. I could able to filter the name and other string/number fields easily with ng-table. But the date range filter is not seems to be working.
My json data for listing
{
"data":[
{
"cellphone":"24234234234",
"createddate":"09/09/2014",
"firstname":"Giacomo",
"resellerid":"747845473"
},
{
"cellphone":"24234234234",
"createddate":"09/02/2010",
"firstname":"Tomy",
"resellerid":"747783"
},
{
"cellphone":"999999",
"createddate":"09/02/2010",
"firstname":"Sunny",
"resellerid":"2312312"
}
]
}
I'm using ng-repeat to traverse this json object.
The filter boxes are outside the table and I'm using following code
<table class="table display table-striped table-bordered" ng-table="tableParams">
<tr ng-repeat="customer in $data | filter: id | filter :name
|filter :createdfrom>
<td data-title="'Reseller ID'" sortable="'resellerid'">
{{customer.resellerid}}
</td>
<td data-title="'Reseller Name'" sortable="'firstname'">
{{customer.firstname}} {{customer.lastname}}
</td>
<td data-title="'Created Date'" sortable="'createddate'">
{{customer.createddate}}
</td>
</tr>
</table>
and in filter boxes which are outside the table
<div class="col-sm-2">
<input type="text" placeholder="747873" id="exampleInputEmail2"
class="form-control" ng-model="id.resellerid">
</div>
<div class="col-sm-2">
<input type="text" placeholder="Enter Name"
id="exampleInputPassword2" class="form-control"
ng-model="name.firstname">
</div>
<input class="form-control" type="text"
datepicker-popup="{{format}}" ng-model="createdfrom.createddate" is-open="opened1"
min-date="minDate" max-date="'2015-06-22'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true"
close-text="Close" placeholder="DD/MM/YY" id="date1" >
<span
class="input-group-btn">
<button type="button" class="btn btn-default"
ng-click="open1($event)">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
</div>
But the date fields are not filtering the json data.
Is there any way to filter the data using dates from "From" and To date fields ?
Any help/hint would be greately appreciated.
Thanks jayesh