title: How to search filter date objects with ngTable in AngularJS
body: <p>I have a table similar to this:</p>
  
  <pre><code>&lt;table ng-table="tableParams" show-filter="true" class="table"&gt;
    &lt;tr ng-repeat="user in $data"&gt;
      &lt;td data-title="'Name'" filter="{'userName':'text'}" sortable="'userName'"&gt;{{user.userName}}&lt;/td&gt;
      &lt;td data-title="'Created'" filter="{'userCreated':'text'}" sortable="'userCreated'"&gt;{{user.userCreated | date:'dd MMM yyyy'}}&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Using <code>ngTable</code> and <code>Angular</code>, this produces a table based on the data I put provide. It allows the user to search each column using a text input. However the search filter does not work on the <code>Created</code> column because it is a javascript date object (that has been filtered to display in a  different format). How can I make search filtering work for dates?</p>
  
  <p>My ngTable function looks like this:</p>
  
  <pre><code>function userTable(){
  
    var data = $scope.userList;
  
    //init ng-table with data
    $scope.tableParams = new ngTableParams({
      page: 1,
      count: 10
    }, {
  
      //data length and filters
      total: data.length,
      getData: function($defer, params) {
  
        //search filter
        var filteredData = params.filter() ?
            $filter('filter')(data, params.filter()) :
            data;
  
        //order filter
        var orderedData = params.sorting() ?
            $filter('orderBy')(filteredData, params.orderBy()) :
            data;
  
        //resolve data
        params.total(orderedData.length);
        $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
      }
  
    });
  }
  </code></pre>
  
  <p>Then I just call <code>usertable(someData);</code></p>