mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-02-01 23:47:35 +00:00
Add locale support for sortsub
This commit is contained in:
@@ -14,7 +14,7 @@ Export our filter function
|
||||
*/
|
||||
exports.sortsub = function(source,operator,options) {
|
||||
// Compile the subfilter
|
||||
var filterFn = options.wiki.compileFilter(operator.operand);
|
||||
var filterFn = options.wiki.compileFilter(operator.operands[0]);
|
||||
// Collect the input titles and the corresponding sort keys
|
||||
var inputTitles = [],
|
||||
sortKeys = [];
|
||||
@@ -34,7 +34,7 @@ exports.sortsub = function(source,operator,options) {
|
||||
indexes[t] = t;
|
||||
}
|
||||
// Sort the indexes
|
||||
var compareFn = $tw.utils.makeCompareFunction(operator.suffix,{defaultType: "string",invert: operator.prefix === "!"});
|
||||
var compareFn = $tw.utils.makeCompareFunction(operator.suffix,{defaultType: "string",invert: operator.prefix === "!",locale: operator.operands[1]});
|
||||
indexes = indexes.sort(function(a,b) {
|
||||
return compareFn(sortKeys[a],sortKeys[b]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user