The sortTiddlers function of the TiddlyWiki class takes 2 parameters
tiddlers - is an array of tiddler objects
field - is the field you wish to sort the tiddlers by (e.g modified or created). It accepts any of the default tiddler fields and can also be used with any extended fields you might have given to tiddlers.
The field parameter can also be prepended with a '+' or a '-' to indicated whether you want the tiddlers to be sorted in ascending or descending order.
For example if I wanted to sort the tiddlers by 'changecount' in descending order I'd put the following:
store.sortTiddlers(tiddlers, field);where
tiddlers - is an array of tiddler objects
field - is the field you wish to sort the tiddlers by (e.g modified or created). It accepts any of the default tiddler fields and can also be used with any extended fields you might have given to tiddlers.
The field parameter can also be prepended with a '+' or a '-' to indicated whether you want the tiddlers to be sorted in ascending or descending order.
For example if I wanted to sort the tiddlers by 'changecount' in descending order I'd put the following:
var sortedTiddlers = store.sortTiddlers(tiddlers, "-changecount");The function then returns the array of tiddlers which has been sorted.