title: Jquery Datatables Date Range Filter
body: <p>The code below is working perfectly but I need to add a new functionality to allow the user to filter on a range of records based on their start date and end date, the user should be able to get all the records in between, I was able to find a datatables page tutorial to implement this but I was not able to add that to the code, can you please help me, here is the link</p>
  
  <p><a href="https://datatables.net/plug-ins/filtering/row-based/range_dates" rel="nofollow noreferrer">https://datatables.net/plug-ins/filtering/row-based/range_dates</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $(function() {
      $("#datepickerStart").datepicker();
      $("#datepickerEnd").datepicker();
    });
  
    // Setup - add a text input to each footer cell
    $('#example tfoot th').each(function() {
      var title = $(this).text();
      if (title === "Start date") {
        $(this).html('&lt;input type="text" id="datepickerStart" placeholder="Search ' + title + '" /&gt;');
      } else if (title === "End date") {
        $(this).html('&lt;input type="text" id="datepickerEnd" placeholder="Search ' + title + '" /&gt;');
      } else {
        $(this).html('&lt;input type="text" placeholder="Search ' + title + '" /&gt;');
      }
    });
  
    // DataTable
    var table = $('#example').DataTable({
  
  
    });
  
  
  
  
  
  
  
    $('#example tbody').on('click', 'tr', function() {
      $(this).toggleClass('selected');
    });
  
  
    $('#example tbody')
      .on('mouseenter', 'td', function() {
        var colIdx = table.cell(this).index().column;
  
        $(table.cells().nodes()).removeClass('highlight');
        $(table.column(colIdx).nodes()).addClass('highlight');
      });
  
  
    $('#button').click(function() {
      alert(table.rows('.selected').data().length + ' row(s) selected');
    });
  
    // Apply the search
    table.columns().every(function() {
      var that = this;
  
      $('input', this.footer()).on('keyup change', function() {
        if (that.search() !== this.value) {
          that
            .search(this.value)
            .draw();
        }
      });
    });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>tfoot input {
    width: 100%;
    padding: 3px;
    box-sizing: border-box;
  }
  
  tr.highlight {
    background-color: blue !important;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdn.datatables.net/plug-ins/9dcbecd42ad/integration/jqueryui/dataTables.jqueryui.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="https://code.jquery.com/ui/1.10.13/themes/smoothness/jquery-ui.css"&gt;
  &lt;link rel="stylesheet" href="https://cdn.datatables.net/plug-ins/9dcbecd42ad/integration/jqueryui/dataTables.jqueryui.css"&gt;
  &lt;link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"&gt;
  
  
  &lt;table id="example" class="display" cellspacing="0" width="100%"&gt;
  
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Name&lt;/th&gt;
        &lt;th&gt;Position&lt;/th&gt;
        &lt;th&gt;Office&lt;/th&gt;
        &lt;th&gt;Age&lt;/th&gt;
        &lt;th&gt;Start date&lt;/th&gt;
        &lt;th&gt;End date&lt;/th&gt;
        &lt;th&gt;Salary&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tfoot&gt;
      &lt;tr&gt;
        &lt;th&gt;Name&lt;/th&gt;
        &lt;th&gt;Position&lt;/th&gt;
        &lt;th&gt;Office&lt;/th&gt;
        &lt;th&gt;Age&lt;/th&gt;
        &lt;th id="min"&gt;Start date&lt;/th&gt;
        &lt;th id="max"&gt;End date&lt;/th&gt;
        &lt;th&gt;Salary&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/tfoot&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Tiger Nixon&lt;/td&gt;
        &lt;td&gt;System Architect&lt;/td&gt;
        &lt;td&gt;Edinburgh&lt;/td&gt;
        &lt;td&gt;61&lt;/td&gt;
        &lt;td&gt;2011/04/25&lt;/td&gt;
        &lt;td&gt;2011/04/27&lt;/td&gt;
        &lt;td&gt;$320,800&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Garrett Winters&lt;/td&gt;
        &lt;td&gt;Accountant&lt;/td&gt;
        &lt;td&gt;Tokyo&lt;/td&gt;
        &lt;td&gt;63&lt;/td&gt;
        &lt;td&gt;2011/07/25&lt;/td&gt;
        &lt;td&gt;2011/04/29&lt;/td&gt;
        &lt;td&gt;$170,750&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Ashton Cox&lt;/td&gt;
        &lt;td&gt;Junior Technical Author&lt;/td&gt;
        &lt;td&gt;San Francisco&lt;/td&gt;
        &lt;td&gt;66&lt;/td&gt;
        &lt;td&gt;2009/01/12&lt;/td&gt;
        &lt;td&gt;2011/04/28&lt;/td&gt;
        &lt;td&gt;$86,000&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Cedric Kelly&lt;/td&gt;
        &lt;td&gt;Senior Javascript Developer&lt;/td&gt;
        &lt;td&gt;Edinburgh&lt;/td&gt;
        &lt;td&gt;22&lt;/td&gt;
        &lt;td&gt;2012/03/29&lt;/td&gt;
        &lt;td&gt;2012/03/30&lt;/td&gt;
        &lt;td&gt;$433,060&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Airi Satou&lt;/td&gt;
        &lt;td&gt;Accountant&lt;/td&gt;
        &lt;td&gt;Tokyo&lt;/td&gt;
        &lt;td&gt;33&lt;/td&gt;
        &lt;td&gt;2008/11/28&lt;/td&gt;
        &lt;td&gt;2008/11/30&lt;/td&gt;
        &lt;td&gt;$162,700&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Brielle Williamson&lt;/td&gt;
        &lt;td&gt;Integration Specialist&lt;/td&gt;
        &lt;td&gt;New York&lt;/td&gt;
        &lt;td&gt;61&lt;/td&gt;
        &lt;td&gt;2012/12/02&lt;/td&gt;
        &lt;td&gt;2012/12/21&lt;/td&gt;
        &lt;td&gt;$372,000&lt;/td&gt;
      &lt;/tr&gt;
  
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>