mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-28 20:21:43 +00:00
Fix problem with sorting date fields
Introduced a couple of commits ago when the localeCompare() stuff was added.
This commit is contained in:
@@ -309,6 +309,8 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is
|
|||||||
a = Number(a);
|
a = Number(a);
|
||||||
b = Number(b);
|
b = Number(b);
|
||||||
return isDescending ? b - a : a - b;
|
return isDescending ? b - a : a - b;
|
||||||
|
} else if($tw.utils.isDate(a) && $tw.utils.isDate(b)) {
|
||||||
|
return isDescending ? b - a : a - b;
|
||||||
} else {
|
} else {
|
||||||
a = String(a);
|
a = String(a);
|
||||||
b = String(b);
|
b = String(b);
|
||||||
|
|||||||
Reference in New Issue
Block a user