I need to filter table data selecting two dates using Angular.js. My code below:
<div class="col-md-3">
<div class="input-group datepicker" date-format="yyyy-MM-dd" button-prev='<i class="fa fa-arrow-circle-left"></i>' button-next='<i class="fa fa-arrow-circle-right"></i>'>
<input type="text" name="birthdate" class="form-control" id="date" ng-model="date" placeholder="From date" />
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
<div class="col-md-3">
<div class=" input-group datepicker" date-format="yyyy-MM-dd" button-prev='<i class="fa fa-arrow-circle-left"></i>' button-next='<i class="fa fa-arrow-circle-right"></i>'>
<input type="text" name="birthdate" class="form-control" id="date" ng-model="date1" placeholder="To date" />
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
<tbody id="detailsstockid">
<tr ng-repeat="d in clickDetail">
<td>{{$index+1}}</td>
<td>{{d.rest_name}}</td>
<td>{{d.Android}}</td>
<td>{{d.IOS}}</td>
<td>{{d.resultant_counter}}</td>
<td>{{d.date}}</td>
</tr>
</tbody>
Here I have two datepicker
fields. When user will select From date
and To date
the record will filter data in between these two date including these dates also. Here I have also d.date
which contains value like this 2016-05-21 15:15:44
from DB. As per this value I need to sort the table data.