From 04555b931e121609aefaf293c3408a76da9d69af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 24 Mar 2014 15:18:32 +0000 Subject: [PATCH] =?UTF-8?q?-=20Sortierung=20Erweitert=20f=C3=BCr=20Tabelle?= =?UTF-8?q?n=20mit=20Spalten=20im=20Format=20'31.12.2014=2015:32'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/js/jquery.tablesorter.js | 15 ++++++++++++++- include/js/jquery1.9.min.js | 11 +++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/js/jquery.tablesorter.js b/include/js/jquery.tablesorter.js index 2619b2031..e42e3b782 100644 --- a/include/js/jquery.tablesorter.js +++ b/include/js/jquery.tablesorter.js @@ -742,6 +742,18 @@ type: "numeric" }); + ts.addParser({ + id: "DatummitUhrzeit", + is: function(s) { + alert("CHECK"); + return s.match(new RegExp(/^[0-9]{1,2}.[0-9]{1,2}.[0-9]{4} ( (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]))$/)); + }, + format: function(s) { + return $.tablesorter.formatFloat(new Date(s).getTime()); + }, + type: "numeric" + }); + ts.addParser({ id: "integer", is: function(s,table) { @@ -806,7 +818,8 @@ }, type: "numeric" }); - + + ts.addParser({ id: "percent", is: function(s) { diff --git a/include/js/jquery1.9.min.js b/include/js/jquery1.9.min.js index 4e4dbcc67..ca4358514 100644 --- a/include/js/jquery1.9.min.js +++ b/include/js/jquery1.9.min.js @@ -768,6 +768,17 @@ type: "numeric" }); + ts.addParser({ + id: "DatummitUhrzeit", + is: function(s) { + return s.match(new RegExp(/^[0-9]{1,2}.[0-9]{1,2}.[0-9]{4} (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]))$/)); + }, + format: function(s) { + return $.tablesorter.formatFloat(new Date(s.replace(/(\d{1,2})[\/\.](\d{1,2})[\/\.](\d{4})/, "$3/$2/$1")).getTime()); + }, + type: "numeric" + }); + ts.addParser({ id: "integer", is: function(s,table) {