Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sort html table rows by first date column with jQuery

I have table with two date columns in each row start date and end date I want to sort table rows by start date with jQuery

Below is the table html code:

<table class="table-bordered">
  <thead>
    <tr class="Headers">
      <th>Number</th>
      <th>Date Start</a></th>
      <th>Date End</th>
    </tr>
  </thead>
  <tbody>
    <tr class="Entries" data-id="13">
      <td data-field-type="string">1234</td>
      <td data-field-type="date">01-04-2015</td>
      <td data-field-type="date">01-04-2015</td>
    </tr>
    <tr class="Entries" data-id="24">
      <td data-field-type="string">1352</td>
      <td data-field-type="date">04-10-2012</td>
      <td data-field-type="date">23-10-2015</td>
    </tr>
    <tr class="Entries" data-id="8">
      <td data-field-type="string">1124</td>
      <td data-field-type="date">13-05-2014</td>
      <td data-field-type="date">01-04-2015</td>
    </tr>
    <tr class="Entries" data-id="23">
      <td data-field-type="string">1652</td>
      <td data-field-type="date">07-11-2013</td>
      <td data-field-type="date">22-10-2015</td>
    </tr>
  </tbody>
</table>

I made a try with similar solution posted here but without success. JSFiddle

like image 593
stav Avatar asked Aug 24 '26 08:08

stav


1 Answers

Look at this site. It looks like this is what you are trying to do. http://www.kryogenix.org/code/browser/sorttable/

like image 195
Odis Harkins Avatar answered Aug 26 '26 22:08

Odis Harkins