Sort by Exact Date
I'm trying to sort by exact date but it doesn't seem to work, only using
>= seems to work. My code is very straight forward:
Script
$(function() {
$("table").tablesorter({
widthFixed : true,
widgets: ["filter"],
widgetOptions : {
filter_formatter : {
0 : function($cell, indx){
return $.tablesorter.filterFormatter.uiDateCompare( $cell, indx, {
dateFormat : 'M dd, yy',
changeMonth : true,
changeYear : true,
compare : '=='
});
}
}
}
});
});
HTML
<table class="tablesorter">
<thead>
<tr>
<th data-placeholder="Sort By Date">Date (one input; greater than)</th>
</tr>
</thead>
<tbody>
<tr><td>Jun 26, 2013</td></tr>
<tr><td>Aug 21, 2013</td></tr>
<tr><td>Oct 13, 2013</td></tr>
<tr><td>Jul 6, 2013</td></tr>
<tr><td>Dec 10, 2012</td></tr>
</tbody>
No comments:
Post a Comment