<!DOCTYPE html>
<html>
  <head>
    <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>
    <link href="https://nightly.datatables.net/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
    <script src="https://nightly.datatables.net/js/jquery.dataTables.js"></script>
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/searchbuilder/1.0.0/css/searchBuilder.dataTables.css"/>
    <script src="https://cdn.datatables.net/plug-ins/1.10.21/sorting/datetime-moment.js" ></script>
<script type="text/javascript" src="https://cdn.datatables.net/searchbuilder/1.1.0/js/dataTables.searchBuilder.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/datetime/1.1.2/js/dataTables.dateTime.min.js"></script>
    
    <meta charset=utf-8 />
    <title>DataTables - JS Bin</title>
  </head>
  <body>
    <div class="container">
      <table id="example" class="display" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>Name</th>
                <th width="20%">Company</th>
                <th>Created</th>
                <th>Updated</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Dai Weeks</td>
                <td>Eu Foundation</td>
                <td>11:10 Oct 18, 14</td>
                <td>Sat, May 16th, 2015</td>
            </tr>
            <tr>
                <td>Jade Dale</td>
                <td>Sit Amet Inc.</td>
                <td>07:04 Apr 29, 14</td>
                <td>Sat, July 25th, 2015</td>
            </tr>
            <tr>
                <td>Melanie Buckner</td>
                <td>Tempus Lorem LLC</td>
                <td>02:01 Jan 28, 15</td>
                <td>Sun, October 11th, 2015</td>
            </tr>
            <tr>
                <td>Cyrus Haney</td>
                <td>Phasellus Corp.</td>
                <td>10:01 Jan 28, 14</td>
                <td>Sat, December 28th, 2013</td>
            </tr>
            <tr>
                <td>Melinda Salas</td>
                <td>Molestie Sed Id Limited</td>
                <td>11:05 May 1, 14</td>
                <td>Fri, May 15th, 2015</td>
            </tr>
            <tr>
                <td>Rebecca Cline</td>
                <td>Eget Dictum Placerat Limited</td>
                <td>02:12 Dec 20, 13</td>
                <td>Wed, August 6th, 2014</td>
            </tr>
            <tr>
                <td>India Lawson</td>
                <td>Eget Company</td>
                <td>11:03 Mar 21, 15</td>
                <td>Fri, July 11th, 2014</td>
            </tr>
            <tr>
                <td>Elvis Whitfield</td>
                <td>Mollis Corporation</td>
                <td>08:07 Jul 30, 15</td>
                <td>Sat, February 28th, 2015</td>
            </tr>
            <tr>
                <td>Castor Monroe</td>
                <td>Iaculis LLC</td>
                <td>12:06 Jun 22, 14</td>
                <td>Mon, June 2nd, 2014</td>
            </tr>
            <tr>
                <td>Gareth Berry</td>
                <td>Malesuada Corp.</td>
                <td>04:02 Feb 26, 14</td>
                <td>Fri, February 27th, 2015</td>
            </tr>
            <tr>
                <td>Anne Knox</td>
                <td>Neque Sed Consulting</td>
                <td>04:04 Apr 11, 14</td>
                <td>Sat, May 24th, 2014</td>
            </tr>
            <tr>
                <td>Kasimir Martin</td>
                <td>Tortor Nunc Consulting</td>
                <td>11:12 Dec 24, 14</td>
                <td>Sat, July 25th, 2015</td>
            </tr>
            <tr>
                <td>Drake Pugh</td>
                <td>Mattis Velit Industries</td>
                <td>03:09 Sep 23, 15</td>
                <td>Wed, March 5th, 2014</td>
            </tr>
            <tr>
                <td>Carla Head</td>
                <td>Pretium Aliquet Institute</td>
                <td>06:09 Sep 2, 15</td>
                <td>Wed, January 8th, 2014</td>
            </tr>
            <tr>
                <td>Shellie Henry</td>
                <td>Scelerisque Ltd</td>
                <td>11:01 Jan 28, 15</td>
                <td>Sun, February 1st, 2015</td>
            </tr>
            <tr>
                <td>Patrick Koch</td>
                <td>Scelerisque Dui LLC</td>
                <td>10:10 Oct 3, 14</td>
                <td>Sun, May 17th, 2015</td>
            </tr>
            <tr>
                <td>Dara Roberts</td>
                <td>Urna Convallis Erat Industries</td>
                <td>11:08 Aug 13, 15</td>
                <td>Sun, June 22nd, 2014</td>
            </tr>
            <tr>
                <td>Yuli Wright</td>
                <td>Auctor Consulting</td>
                <td>05:07 Jul 22, 14</td>
                <td>Tue, March 25th, 2014</td>
            </tr>
            <tr>
                <td>Cyrus Jensen</td>
                <td>Et Risus Associates</td>
                <td>10:09 Sep 19, 15</td>
                <td>Sat, May 16th, 2015</td>
            </tr>
            <tr>
                <td>Holmes Talley</td>
                <td>Urna Nullam Lobortis Consulting</td>
                <td>01:12 Dec 25, 14</td>
                <td>Thu, February 13th, 2014</td>
            </tr>
            <tr>
                <td>Iris Carver</td>
                <td>Laoreet Lectus Quis LLC</td>
                <td>12:10 Oct 13, 14</td>
                <td>Fri, November 7th, 2014</td>
            </tr>
            <tr>
                <td>Leroy Cantrell</td>
                <td>In LLC</td>
                <td>03:05 May 5, 15</td>
                <td>Tue, June 2nd, 2015</td>
            </tr>
            <tr>
                <td>Maggie Aguilar</td>
                <td>Mauris PC</td>
                <td>02:12 Dec 7, 14</td>
                <td>Thu, November 20th, 2014</td>
            </tr>
            <tr>
                <td>Maggy Porter</td>
                <td>Mauris Blandit Ltd</td>
                <td>11:06 Jun 4, 14</td>
                <td>Tue, November 11th, 2014</td>
            </tr>
            <tr>
                <td>Liberty Warner</td>
                <td>Ipsum Company</td>
                <td>05:11 Nov 17, 15</td>
                <td>Mon, October 5th, 2015</td>
            </tr>
            <tr>
                <td>Raya Dean</td>
                <td>Felis Foundation</td>
                <td>02:12 Dec 18, 14</td>
                <td>Mon, February 10th, 2014</td>
            </tr>
            <tr>
                <td>Jack Juarez</td>
                <td>Nunc Limited</td>
                <td>01:09 Sep 7, 15</td>
                <td>Mon, December 22nd, 2014</td>
            </tr>
            <tr>
                <td>Nola King</td>
                <td>Varius Orci Incorporated</td>
                <td>04:05 May 12, 15</td>
                <td>Tue, June 24th, 2014</td>
            </tr>
            <tr>
                <td>Carlos Holman</td>
                <td>Odio LLC</td>
                <td>01:08 Aug 16, 15</td>
                <td>Thu, August 20th, 2015</td>
            </tr>
            <tr>
                <td>Aquila Finch</td>
                <td>Egestas Ligula Nullam Institute</td>
                <td>12:09 Sep 3, 15</td>
                <td>Sat, March 22nd, 2014</td>
            </tr>
            <tr>
                <td>Seth Porter</td>
                <td>Sem Ut Inc.</td>
                <td>01:06 Jun 4, 15</td>
                <td>Sun, March 1st, 2015</td>
            </tr>
            <tr>
                <td>Oleg Mcpherson</td>
                <td>Nunc Ac Sem LLP</td>
                <td>03:08 Aug 3, 14</td>
                <td>Sun, September 21st, 2014</td>
            </tr>
            <tr>
                <td>Kennan Snyder</td>
                <td>Amet Consectetuer Associates</td>
                <td>06:01 Jan 23, 14</td>
                <td>Mon, April 7th, 2014</td>
            </tr>
            <tr>
                <td>Emery Donovan</td>
                <td>Dapibus Inc.</td>
                <td>08:06 Jun 14, 14</td>
                <td>Tue, September 30th, 2014</td>
            </tr>
            <tr>
                <td>Naida Hunter</td>
                <td>Augue Scelerisque Mollis Inc.</td>
                <td>11:12 Dec 23, 13</td>
                <td>Sun, July 19th, 2015</td>
            </tr>
            <tr>
                <td>Clinton Morrison</td>
                <td>Non Lacinia Industries</td>
                <td>02:03 Mar 18, 14</td>
                <td>Fri, March 6th, 2015</td>
            </tr>
            <tr>
                <td>Helen Gutierrez</td>
                <td>Faucibus Incorporated</td>
                <td>07:08 Aug 7, 15</td>
                <td>Tue, February 4th, 2014</td>
            </tr>
            <tr>
                <td>Candice Bonner</td>
                <td>Donec LLP</td>
                <td>05:12 Dec 28, 13</td>
                <td>Mon, March 16th, 2015</td>
            </tr>
            <tr>
                <td>Nissim Carter</td>
                <td>Suspendisse Sed Limited</td>
                <td>01:03 Mar 19, 14</td>
                <td>Mon, June 29th, 2015</td>
            </tr>
            <tr>
                <td>Kasimir Hoffman</td>
                <td>Id Libero Donec Consulting</td>
                <td>05:12 Dec 23, 14</td>
                <td>Wed, September 23rd, 2015</td>
            </tr>
            <tr>
                <td>Imogene Mcconnell</td>
                <td>Vitae Associates</td>
                <td>07:02 Feb 17, 15</td>
                <td>Tue, July 22nd, 2014</td>
            </tr>
            <tr>
                <td>Sage Mosley</td>
                <td>Metus In Inc.</td>
                <td>05:05 May 24, 15</td>
                <td>Mon, April 21st, 2014</td>
            </tr>
            <tr>
                <td>Sybil Puckett</td>
                <td>Vel Lectus LLP</td>
                <td>09:06 Jun 9, 14</td>
                <td>Sat, September 6th, 2014</td>
            </tr>
            <tr>
                <td>Kylynn Solis</td>
                <td>Ac Limited</td>
                <td>10:01 Jan 20, 15</td>
                <td>Tue, September 15th, 2015</td>
            </tr>
            <tr>
                <td>Beatrice Hurley</td>
                <td>Mauris A Nunc Corporation</td>
                <td>04:05 May 11, 14</td>
                <td>Sun, April 26th, 2015</td>
            </tr>
            <tr>
                <td>Troy Marquez</td>
                <td>Dapibus Quam Institute</td>
                <td>12:02 Feb 7, 15</td>
                <td>Thu, April 23rd, 2015</td>
            </tr>
            <tr>
                <td>Malcolm Payne</td>
                <td>Adipiscing Ligula Institute</td>
                <td>04:08 Aug 17, 15</td>
                <td>Tue, September 2nd, 2014</td>
            </tr>
            <tr>
                <td>Wade Valenzuela</td>
                <td>Sagittis Duis Gravida Corporation</td>
                <td>03:05 May 22, 14</td>
                <td>Mon, January 13th, 2014</td>
            </tr>
            <tr>
                <td>Kathleen Gilmore</td>
                <td>Urna Nec Ltd</td>
                <td>05:03 Mar 5, 14</td>
                <td>Mon, November 16th, 2015</td>
            </tr>
            <tr>
                <td>Maite Scott</td>
                <td>Ipsum Cursus Inc.</td>
                <td>01:05 May 28, 14</td>
                <td>Sun, June 8th, 2014</td>
            </tr>
            <tr>
                <td>Kamal Nash</td>
                <td>Sem Vitae Company</td>
                <td>05:10 Oct 7, 14</td>
                <td>Thu, June 26th, 2014</td>
            </tr>
            <tr>
                <td>Iliana West</td>
                <td>Ac Eleifend Limited</td>
                <td>01:10 Oct 24, 15</td>
                <td>Wed, July 2nd, 2014</td>
            </tr>
            <tr>
                <td>Susan Osborn</td>
                <td>Sollicitudin Adipiscing Ligula Institute</td>
                <td>03:02 Feb 18, 14</td>
                <td>Sat, June 13th, 2015</td>
            </tr>
            <tr>
                <td>Adena Carter</td>
                <td>Nibh Industries</td>
                <td>04:01 Jan 27, 15</td>
                <td>Tue, February 3rd, 2015</td>
            </tr>
            <tr>
                <td>Duncan Mckinney</td>
                <td>Vel Convallis In Inc.</td>
                <td>09:11 Nov 23, 15</td>
                <td>Sat, December 12th, 2015</td>
            </tr>
            <tr>
                <td>Ariana Whitehead</td>
                <td>Fermentum Metus Associates</td>
                <td>03:06 Jun 9, 14</td>
                <td>Tue, December 15th, 2015</td>
            </tr>
            <tr>
                <td>Fiona Henderson</td>
                <td>Eget Tincidunt Dui Inc.</td>
                <td>03:01 Jan 1, 14</td>
                <td>Fri, January 9th, 2015</td>
            </tr>
            <tr>
                <td>Judah Gates</td>
                <td>Donec Felis Associates</td>
                <td>04:11 Nov 30, 15</td>
                <td>Mon, September 28th, 2015</td>
            </tr>
            <tr>
                <td>Hasad Mccarthy</td>
                <td>Ac Tellus Company</td>
                <td>12:01 Jan 21, 14</td>
                <td>Mon, January 27th, 2014</td>
            </tr>
            <tr>
                <td>Shay Valencia</td>
                <td>Natoque Associates</td>
                <td>05:03 Mar 4, 14</td>
                <td>Mon, December 15th, 2014</td>
            </tr>
            <tr>
                <td>Hillary Tran</td>
                <td>Integer Mollis Foundation</td>
                <td>08:12 Dec 31, 14</td>
                <td>Wed, August 26th, 2015</td>
            </tr>
            <tr>
                <td>Margaret Sellers</td>
                <td>Lacus Quisque Corporation</td>
                <td>11:10 Oct 17, 15</td>
                <td>Sun, July 5th, 2015</td>
            </tr>
            <tr>
                <td>Prescott Morton</td>
                <td>Vestibulum Associates</td>
                <td>01:04 Apr 27, 15</td>
                <td>Sun, June 14th, 2015</td>
            </tr>
            <tr>
                <td>Charity Gilbert</td>
                <td>Tortor At Risus Associates</td>
                <td>01:07 Jul 31, 14</td>
                <td>Thu, December 18th, 2014</td>
            </tr>
            <tr>
                <td>Freya Randolph</td>
                <td>Ut Institute</td>
                <td>07:11 Nov 3, 15</td>
                <td>Sat, September 27th, 2014</td>
            </tr>
            <tr>
                <td>Nita Howe</td>
                <td>Ornare Fusce Inc.</td>
                <td>11:02 Feb 12, 14</td>
                <td>Tue, June 9th, 2015</td>
            </tr>
            <tr>
                <td>Kirby Whitney</td>
                <td>Faucibus Morbi Vehicula Foundation</td>
                <td>11:12 Dec 22, 13</td>
                <td>Wed, August 26th, 2015</td>
            </tr>
            <tr>
                <td>Amos Jarvis</td>
                <td>Mauris Suspendisse Aliquet LLP</td>
                <td>01:05 May 10, 15</td>
                <td>Mon, July 14th, 2014</td>
            </tr>
            <tr>
                <td>Kim Hunter</td>
                <td>Ligula Donec Luctus Corp.</td>
                <td>07:11 Nov 25, 15</td>
                <td>Thu, October 23rd, 2014</td>
            </tr>
            <tr>
                <td>Rosalyn Benton</td>
                <td>Iaculis Quis Pede Corp.</td>
                <td>02:09 Sep 16, 14</td>
                <td>Sun, November 15th, 2015</td>
            </tr>
            <tr>
                <td>Anjolie Floyd</td>
                <td>Nunc Corp.</td>
                <td>12:03 Mar 28, 14</td>
                <td>Mon, December 1st, 2014</td>
            </tr>
            <tr>
                <td>Basil Harmon</td>
                <td>Semper Rutrum Fusce PC</td>
                <td>05:12 Dec 9, 15</td>
                <td>Wed, September 17th, 2014</td>
            </tr>
            <tr>
                <td>Kermit Herrera</td>
                <td>Sed Tortor Integer Limited</td>
                <td>03:09 Sep 26, 14</td>
                <td>Sun, June 14th, 2015</td>
            </tr>
            <tr>
                <td>Winifred Pearson</td>
                <td>Augue Industries</td>
                <td>10:09 Sep 18, 15</td>
                <td>Tue, August 4th, 2015</td>
            </tr>
            <tr>
                <td>Lester Fischer</td>
                <td>Aenean PC</td>
                <td>02:09 Sep 15, 15</td>
                <td>Wed, July 29th, 2015</td>
            </tr>
            <tr>
                <td>Tatum Daugherty</td>
                <td>Nunc Nulla LLP</td>
                <td>09:06 Jun 25, 15</td>
                <td>Wed, February 19th, 2014</td>
            </tr>
            <tr>
                <td>Zachary Wilder</td>
                <td>Nec LLC</td>
                <td>03:09 Sep 19, 14</td>
                <td>Wed, April 8th, 2015</td>
            </tr>
            <tr>
                <td>Laith Peters</td>
                <td>Ipsum Leo Elementum Institute</td>
                <td>11:06 Jun 17, 14</td>
                <td>Thu, November 13th, 2014</td>
            </tr>
            <tr>
                <td>Evelyn Ramos</td>
                <td>Nunc Industries</td>
                <td>01:06 Jun 3, 14</td>
                <td>Thu, April 10th, 2014</td>
            </tr>
            <tr>
                <td>Mara Michael</td>
                <td>Ut Aliquam LLC</td>
                <td>10:07 Jul 14, 14</td>
                <td>Thu, November 26th, 2015</td>
            </tr>
            <tr>
                <td>Jemima Powers</td>
                <td>Eu Arcu Morbi LLP</td>
                <td>06:08 Aug 4, 14</td>
                <td>Fri, May 1st, 2015</td>
            </tr>
            <tr>
                <td>Tanek Guthrie</td>
                <td>Sit Associates</td>
                <td>09:02 Feb 19, 15</td>
                <td>Thu, May 28th, 2015</td>
            </tr>
            <tr>
                <td>Harriet Crane</td>
                <td>Quis Accumsan Ltd</td>
                <td>12:08 Aug 2, 14</td>
                <td>Sun, December 13th, 2015</td>
            </tr>
            <tr>
                <td>Jin Bond</td>
                <td>Auctor Quis Corp.</td>
                <td>09:08 Aug 25, 15</td>
                <td>Tue, November 18th, 2014</td>
            </tr>
            <tr>
                <td>Ursa Jacobs</td>
                <td>Convallis Ante PC</td>
                <td>08:04 Apr 5, 14</td>
                <td>Tue, February 18th, 2014</td>
            </tr>
            <tr>
                <td>Jason Collier</td>
                <td>Vel Pede Blandit Ltd</td>
                <td>01:05 May 12, 14</td>
                <td>Mon, September 21st, 2015</td>
            </tr>
            <tr>
                <td>Quemby Stone</td>
                <td>Lacus Quisque Incorporated</td>
                <td>09:08 Aug 10, 15</td>
                <td>Thu, July 2nd, 2015</td>
            </tr>
            <tr>
                <td>Melvin Sweet</td>
                <td>Nec Foundation</td>
                <td>05:01 Jan 17, 15</td>
                <td>Thu, May 22nd, 2014</td>
            </tr>
            <tr>
                <td>Thor Wilson</td>
                <td>Arcu Vivamus Sit Industries</td>
                <td>02:02 Feb 17, 15</td>
                <td>Thu, August 7th, 2014</td>
            </tr>
            <tr>
                <td>Burton Marquez</td>
                <td>Augue Corporation</td>
                <td>09:12 Dec 2, 15</td>
                <td>Wed, November 26th, 2014</td>
            </tr>
            <tr>
                <td>Kai Ware</td>
                <td>Facilisis Vitae Limited</td>
                <td>12:06 Jun 23, 14</td>
                <td>Sun, June 29th, 2014</td>
            </tr>
            <tr>
                <td>Holmes Murphy</td>
                <td>Dui Nec Tempus Inc.</td>
                <td>12:10 Oct 25, 15</td>
                <td>Sun, April 26th, 2015</td>
            </tr>
            <tr>
                <td>Blaine Valentine</td>
                <td>Proin Institute</td>
                <td>04:10 Oct 16, 14</td>
                <td>Mon, March 30th, 2015</td>
            </tr>
            <tr>
                <td>Lionel Pacheco</td>
                <td>Dolor Company</td>
                <td>07:03 Mar 18, 14</td>
                <td>Sat, May 24th, 2014</td>
            </tr>
            <tr>
                <td>Keefe Fletcher</td>
                <td>A Mi Fringilla Industries</td>
                <td>03:09 Sep 25, 15</td>
                <td>Thu, October 22nd, 2015</td>
            </tr>
            <tr>
                <td>Slade Rojas</td>
                <td>Sodales Nisi Magna PC</td>
                <td>08:09 Sep 1, 15</td>
                <td>Wed, June 11th, 2014</td>
            </tr>
            <tr>
                <td>Vanna Kirkland</td>
                <td>Tempus Inc.</td>
                <td>03:02 Feb 14, 15</td>
                <td>Wed, December 9th, 2015</td>
            </tr>
            <tr>
                <td>Cameron Peters</td>
                <td>Lobortis Tellus Justo Limited</td>
                <td>06:02 Feb 9, 15</td>
                <td>Fri, January 2nd, 2015</td>
            </tr>
            <tr>
                <td>Reed Freeman</td>
                <td>Augue Sed Molestie LLP</td>
                <td>01:09 Sep 24, 15</td>
                <td>Sun, July 19th, 2015</td>
            </tr>
            <tr>
                <td>Florence Burgess</td>
                <td>Aliquam Auctor Velit Incorporated</td>
                <td>05:04 Apr 20, 14</td>
                <td>Mon, September 8th, 2014</td>
            </tr>
        </tbody>
    </table>    </div>
  </body>
</html>
 
body {
  font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #fff;
}
 
$(document).ready( function () {
  $.fn.dataTable.moment( 'HH:mm MMM D, YY' );
$.fn.dataTable.moment( 'ddd, MMMM Do, YYYY' );
  
  var table = $('#example').DataTable({
    dom: "Qfrtip",
    searchBuilder:{
      conditions:{
        moment:{
          between:{
            init: function(that, fn, preDefined = null) {
               // Declare all of the date elements that are required using DataTables dateTime plugin
              let els = [
                $('<input/>')
                  .addClass("dtsb-value")
                  .addClass("dtsb-input")
                  .dtDateTime({
                    attachTo: 'input',
                    format: that.s.momentFormat ? that.s.momentFormat : undefined
                  })
                  .on('input change', function() { fn(that, this); }),
                $('<span>')
                  .addClass(that.classes.joiner)
                  .text('and'),
                $('<input/>')
                  .addClass("dtsb-value")
                  .addClass("dtsb-input")
                  .dtDateTime({
                    attachTo: 'input',
                    format: that.s.momentFormat ? that.s.momentFormat : undefined
                  })
                  .on('input change', function() { fn(that, this); })
              ];
              // If there are and preDefined values then add them
              if (preDefined !== null && preDefined.length > 0) {
                $(els[0]).val(preDefined[0]);
                $(els[2]).val(preDefined[1]);
              }
              else {
                $(els[0]).val("00:00 Jan 27, 15");
                $(els[2]).val("23:59 Jan 27, 15");
              }
              
              that.s.value = ["00:00 Jan 27, 15", "23:59 Jan 27, 15"];
              return els;
            }
          }
        }
      }
    }
  });
  
} );
2 warnings
Line 12: 'default parameters' is only available in ES6 (use esnext option).
Line 14: 'let' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers