HBASE-24652 master-status UI make date type fields sortable
This commit is contained in:
parent
19f5ad5e30
commit
356cfe9351
|
@ -452,8 +452,20 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
|
|||
return $.tablesorter.formatFloat( s.replace(/,/g,'') );
|
||||
}, type: "numeric"
|
||||
});
|
||||
$.tablesorter.addParser(
|
||||
{
|
||||
id: "dateTime",
|
||||
is: function (s) {
|
||||
return /^([a-zA-Z]{3}\s){2}\d{2}\s\d{2}:\d{2}:\d{2}\s[a-zA-Z]{3}\s\d{4}$/.test(s);
|
||||
}, format: function (s) {
|
||||
var split = s.split(" ");
|
||||
var time = Date.parse(split[1] + " " + split[2] + " " + split[3] + " " + split[5]);
|
||||
return $.tablesorter.formatFloat(time);
|
||||
}, type: "numeric"
|
||||
});
|
||||
$("#baseStatsTable").tablesorter({
|
||||
headers: {
|
||||
1: {sorter: 'dateTime'},
|
||||
4: {sorter: 'separator'},
|
||||
5: {sorter: 'separator'}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue