Skip to content

Commit

Permalink
adding german datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
jurkov authored May 12, 2017
1 parent 43c6ee1 commit b970868
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion templates/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,26 @@ <h1>Padlist</h1>

<script type="text/javascript">
$(document).ready(function() {
$.tablesorter.addParser({
id: 'germandatetime',
is: function(s) {
return false;
},
format: function(s) {
var a = s.split('.');
a[1] = a[1].replace(/^[0]+/g,"");
tmp = a[2].split(' ');
a[2] = tmp[0]
t = tmp[1].split(':');

return new Date(a[2],a[1]-1,a[0],t[0],t[1],t[2]).getTime();
},
type: 'numeric'
});
// call the tablesorter plugin
$("table").tablesorter();
$("table").tablesorter({
headers: { 2: { sorter:'germandatetime' }}
});
});
</script>

Expand Down

0 comments on commit b970868

Please sign in to comment.