From 04e6e6c5414c1bc0a120ee70593eca7db74d1b0e Mon Sep 17 00:00:00 2001 From: Greg Date: Thu, 3 Dec 2015 14:13:00 -0500 Subject: [PATCH] o Use tablesorter shortDate sorter to sort datetime columns. --- .../public/javascripts/page_history.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/debomatic-webui/public/javascripts/page_history.js b/debomatic-webui/public/javascripts/page_history.js index 70f4e56..384f398 100644 --- a/debomatic-webui/public/javascripts/page_history.js +++ b/debomatic-webui/public/javascripts/page_history.js @@ -83,17 +83,6 @@ function Page_History() { sortAsc: 'glyphicon glyphicon-chevron-up', sortDesc: 'glyphicon glyphicon-chevron-down', }); - $.tablesorter.addParser({ - id: "datetime", - is: function (s) { - return false; - }, - format: function (s, table) { - s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})(.*)/, "$3/$2/$1$4"); - return $.tablesorter.formatFloat(new Date(s).getTime()); - }, - type: "numeric" - }); // call the tablesorter plugin and apply the uitheme widget $("table").tablesorter({ @@ -109,10 +98,10 @@ function Page_History() { }, headers: { 2: { - sorter: 'datetime' + sorter: 'shortDate' }, 3: { - sorter: 'datetime' + sorter: 'shortDate' } } });