這是我的HTML
代碼。tablesorter()dd-MMM-yyyy格式的jQuery函數
此代碼不適用於日期格式,而是按字符串格式進行排序。
我還提到了jquery tablesorter sort date dd mmm yyyy之類的一篇文章。
但是對於這種格式它不起作用。
我使用像
^(([0-9])|([0-2][0-9])|([3][0-1]))\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\-\d{4}$
仍然無法正常使用正則表達式。請幫我
<html>
<head><title>
</title><link href="themes/blue/style.css" rel="stylesheet" /><link href="themes/green/style.css" rel="stylesheet" />
<script src="jQuery/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="jQuery/jquery.tablesorter.js" type="text/javascript"></script>
<script src="jQuery/TableSorter.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#GrdViewEmployee").tablesorter({
sortList: [[0, 0], [2, 1]],
widgets:'zebra'
});
});
</script>
</head>
<body class="tablesorterBlue">
<form method="post" action="WebForm1.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="fauQ7GKDqTon5mt7NHJnOCzVzfTVHWHj+gG3j+CA8mTf4JJVPho0PBzFatn/hz/0xu7X0+jfUVQHlCgPQh5CNnoHCyzZOnTqgr7nSstUfCj5JlrZkhV7468h3Vx1e7Er" />
</div>
<div>
<table cellspacing="0" rules="all" class="tablesorterBlue" border="1" id="GrdViewEmployee" style="border-collapse:collapse;">
<thead>
<tr>
<th scope="col">empId</th><th scope="col">empName</th><th scope="col">empEMail</th><th scope="col">empPhone</th>
</tr>
</thead><tbody>
<tr>
<td>1</td><td>rameshwar</td><td>[email protected]</td><td>2-Aug-2013</td>
</tr><tr>
<td>2</td><td>shrivatsav</td><td>[email protected]</td><td>27-Aug-2013</td>
</tr><tr>
<td>3</td><td>ganga</td><td>[email protected]</td><td>14-Jan-2013</td>
</tr><tr>
<td>4</td><td>krishna</td><td>[email protected]</td><td>13-Jan-2014</td>
</tr><tr>
<td>5</td><td>mahesh</td><td>[email protected]</td><td>30-Nov-2013</td>
</tr><tr>
<td>6</td><td>Shridhar</td><td>[email protected]</td><td>1-Dec-2013</td>
</tr>
</tbody><tfoot>
</tfoot>
</table>
</div>
</form>
</body>
</html>
我不確定你運行的是什麼版本,但是這可能有幫助:http://mottie.github.io/ tablesorter/docs/example-option-date-format.html – entropic
請參閱[this](http://drumcoder.co.uk/blog/2010/mar/15/jquery-tablesorter-and-dates/)博客,希望它幫助:) – Aravind