summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-30 19:28:11 +0100
committerDan McGee <dan@archlinux.org>2011-11-30 19:29:27 +0100
commitb05eae96a4be8990a1de81795013587ded7ed3aa (patch)
treecaf383099123688099c1f73c83d33458d6b70b8e /media
parent9279d9a04cc99691ab6c7fbafe7db03a757d23e8 (diff)
downloadarchweb-b05eae96a4be8990a1de81795013587ded7ed3aa.tar.gz
archweb-b05eae96a4be8990a1de81795013587ded7ed3aa.tar.xz
Add more precise sort for last update signoff column
This allows sorting by the exact time recorded in the database, even if we don't show it directly to the user, which makes finding the most recent updates a lot easier. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'media')
-rw-r--r--media/archweb.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/media/archweb.js b/media/archweb.js
index 4f098c7..151d0f8 100644
--- a/media/archweb.js
+++ b/media/archweb.js
@@ -55,6 +55,19 @@ if (typeof $.tablesorter !== 'undefined') {
type: 'numeric'
});
$.tablesorter.addParser({
+ id: 'epochdate',
+ is: function(s) { return false; },
+ format: function(s, t, c) {
+ /* TODO: this assumes our magic class is the only one */
+ var epoch = $(c).attr('class');
+ if (!epoch.indexOf('epoch-') == 0) {
+ return 0;
+ }
+ return epoch.slice(6);
+ },
+ type: 'numeric'
+ });
+ $.tablesorter.addParser({
id: 'longDateTime',
re: /^(\d{4})-(\d{2})-(\d{2}) ([012]\d):([0-5]\d)(:([0-5]\d))?( (\w+))?$/,
is: function(s) {