1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-07-07 20:42:50 +00:00

Fix problem with sortTiddlers

This commit is contained in:
Jeremy Ruston 2012-10-23 16:28:38 +01:00
parent 8d4be5934b
commit 3a710ad9ce

View File

@ -256,8 +256,12 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive) {
b = self.getTiddler(b).fields[sortField] || ""; b = self.getTiddler(b).fields[sortField] || "";
} }
if(!isCaseSensitive) { if(!isCaseSensitive) {
a = a.toLowerCase(); if(typeof a === "string") {
b = b.toLowerCase(); a = a.toLowerCase();
}
if(typeof b === "string") {
b = b.toLowerCase();
}
} }
if(a < b) { if(a < b) {
return isDescending ? +1 : -1; return isDescending ? +1 : -1;