title: How to add custom search by date range in jQuery DataTables?
body: <p>I use DataTables 1.10.6 (<a href="https://datatables.net/" rel="nofollow">https://datatables.net/</a>) on ASP.NET MVC project. </p>
  
  <p>There I have table with variable columns count (depends on table, defined on load). For some columns I have simple text search, for other - drop-down values search. And for one column (with dates) I need to provide date range search.
  I try this solution <a href="https://datatables.net/examples/plug-ins/range_filtering.html" rel="nofollow">https://datatables.net/examples/plug-ins/range_filtering.html</a> but it runs after table initialization (for every table and for same column with index <code>3</code>) while I need it only when value in input field is changed.</p>
  
  <p>I try this code (from example):</p>
  
  <pre><code>$.fn.dataTable.ext.search.push(
      function( settings, data, dataIndex ) {
          var min = parseInt( $('#min').val(), 10 );
          var max = parseInt( $('#max').val(), 10 );
          var age = parseFloat( data[3] ) || 0; // use data for the age column
  
          if ( ( isNaN( min ) &amp;&amp; isNaN( max ) ) ||
               ( isNaN( min ) &amp;&amp; age &lt;= max ) ||
               ( min &lt;= age   &amp;&amp; isNaN( max ) ) ||
               ( min &lt;= age   &amp;&amp; age &lt;= max ) )
          {
              return true;
          }
          return false;
      }
  );
  </code></pre>
  
  <p>But this code does not depends on table and when I have two tables on same page I don't know how to take input value from current table.
  I need custom search function that can take min/max values, column index (where to search) and works per table.</p>
  
  <p>I need something like this:</p>
  
  <pre><code>function DatarangeColumnCustomSearch(searchQuery) {
      if (searchQuery != undefined) {
          var startDate = Date.parse(searchQuery[0]),
              endDate = Date.parse(searchQuery[1]),
              comparativeDate = Date.parse(rowData[*...current column...*]);
          if (startDate &lt;= comparativeDate &amp;&amp; comparativeDate &lt; endDate.addDays(1)) {
              return true;
          } else {
              return false;
          }
      } else {
          return true;
      }
  }
  
  
  table.api().columns('.whereSearchForDaterange').every(function() {
      var column = this;
      $('input.datarangeFilter', this.footer()).on('keyup change', function () {
          var dates = this.value.split(' - ');
          column.DatarangeColumnCustomSearch(dates).draw();
      });
  });
  </code></pre>
  
  <p>Please, help!</p>