]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Use locale aware comparison when sorting tables
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 4 Jul 2011 11:55:27 +0000 (11:55 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 4 Jul 2011 11:55:27 +0000 (11:55 +0000)
sorttable/sorttable.js

index 2a104711c8600123c72428cc6c10a7af107c538b..837c56c22fc77d3547d42b04dfb382ef7065af5e 100644 (file)
@@ -264,9 +264,7 @@ sorttable = {
     return aa-bb;
   },
   sort_alpha: function(a,b) {
-    if (a[0]==b[0]) return 0;
-    if (a[0]<b[0]) return -1;
-    return 1;
+    return a[0].localeCompare(b[0]);
   },
   sort_ddmm: function(a,b) {
     mtch = a[0].match(sorttable.DATE_RE);