mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-01-30 04:11:32 -08:00
:reverse was ignored when prefix sorting by version (#9280)
This commit is contained in:
parent
b061f90f87
commit
b5153c0066
2 changed files with 3 additions and 1 deletions
|
|
@ -1049,7 +1049,7 @@ exports.makeCompareFunction = function(type,options) {
|
|||
return compare(dateA,dateB);
|
||||
},
|
||||
"version": function(a,b) {
|
||||
return $tw.utils.compareVersions(a,b);
|
||||
return compare($tw.utils.compareVersions(a,b),0);
|
||||
},
|
||||
"alphanumeric": function(a,b) {
|
||||
if(!isCaseSensitive) {
|
||||
|
|
|
|||
|
|
@ -420,6 +420,8 @@ describe("'reduce' and 'intersection' filter prefix tests", function() {
|
|||
expect(wiki.filterTiddlers("[tag[cakes]] :sort:string[{!!title}]").join(",")).toBe("cheesecake,Cheesecake,chocolate cake,Chocolate Cake,Persian love cake,Pound cake");
|
||||
expect(wiki.filterTiddlers("[tag[cakes]] :sort:string:casesensitive[{!!title}]").join(",")).toBe("Cheesecake,Chocolate Cake,Persian love cake,Pound cake,cheesecake,chocolate cake");
|
||||
expect(wiki.filterTiddlers("[tag[cakes]] :sort:string:casesensitive,reverse[{!!title}]").join(",")).toBe("chocolate cake,cheesecake,Pound cake,Persian love cake,Chocolate Cake,Cheesecake");
|
||||
expect(wiki.filterTiddlers("1.2.0 1.0.0 1.0.5 :sort:version[{!!title}]").join(",")).toBe("1.0.0,1.0.5,1.2.0");
|
||||
expect(wiki.filterTiddlers("1.2.0 1.0.0 1.0.5 :sort:version:reverse[{!!title}]").join(",")).toBe("1.2.0,1.0.5,1.0.0");
|
||||
});
|
||||
|
||||
it("should handle the :map prefix", function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue