Merge pull request #401 from kirkins/patch-2

Fix sort by date on nodes and index page
This commit is contained in:
Mike Terzo
2017-10-16 19:51:15 -04:00
committed by GitHub
3 changed files with 6 additions and 4 deletions

View File

@@ -11,7 +11,9 @@
} }
$('thead th.date').data('sortBy', function(th, td, tablesort) { $('thead th.date').data('sortBy', function(th, td, tablesort) {
return moment.utc(td.text()).unix(); var tdTime = new Date(td.text().replace("-", ""));
if(isNaN(tdTime)) return 0;
else return tdTime;
}); });
$('input.filter-table').parent('div').removeClass('hide'); $('input.filter-table').parent('div').removeClass('hide');

View File

@@ -87,7 +87,7 @@
<tr> <tr>
<th class="five wide">Status</th> <th class="five wide">Status</th>
<th class="five wide">Certname</th> <th class="five wide">Certname</th>
<th class="five wide default-sort">Report</th> <th class="date five wide default-sort">Report</th>
<th class="one wide"></th> <th class="one wide"></th>
</tr> </tr>
</thead> </thead>

View File

@@ -9,8 +9,8 @@
<tr> <tr>
<th>Status</th> <th>Status</th>
<th class="default">Certname</th> <th class="default">Certname</th>
<th class="default-sort">Catalog</th> <th class="date default-sort">Catalog</th>
<th>Report</th> <th class="date">Report</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
</thead> </thead>