Can you make a sidebar tab sorted by the date shown in the title?

151 views
Skip to first unread message

j3d1H

unread,
Mar 3, 2018, 2:15:04 PM3/3/18
to TiddlyWiki
I have a lot of tiddlers that start with a date in the format YYYY/MM/DD, and I want a tiddler that will sort and show these tiddlers not by when they were created, nor edited, but the date they show in the title. These tiddlers will always start with the date, and always in that exact format. Does anyone know how to do this?

Note: I have looked, and found this and this, but I think they're not quite what I'm trying to do. I don't want to use tags or anything, just the title. I'm sorry if this is spam - I haven't found anything I thought I could use!

Thank you for any help offered.

Jed Carty

unread,
Mar 4, 2018, 5:03:20 AM3/4/18
to TiddlyWiki
I don't think that this can be done without creating a new filter operator.

PMario

unread,
Mar 4, 2018, 6:10:01 AM3/4/18
to TiddlyWiki
Hi,

Can you use YYYY/0MM/0DD?  Because it would work out of the box.

-m

Michael Wiktowy

unread,
Mar 4, 2018, 2:01:31 PM3/4/18
to TiddlyWiki
I agree. I use that zero padded year-month-day date format often *because* it sorts chronologically while sorting alphanumerically with a simple sort[].

/Mike

j3d1H

unread,
Mar 5, 2018, 4:07:21 PM3/5/18
to TiddlyWiki
PMario: I really don't want to have to change how the titles actually look (personal preference, sorry), so is there a different way to do it? It would be nice for it to just work, but that's not necessarily what I'm looking for.

Jed Carty

unread,
Mar 5, 2018, 4:56:24 PM3/5/18
to TiddlyWiki
If you know any javascript than making a filter operator to do this wouldn't be too terribly difficult, there are just a lot of things to keep track of.

Since some browsers (namely chrome) don't have stable sorts you have to sort by year (since each title starts with a 4 digit year this should just be a normal sort), then for each year that appears in the list make a list of all the tiddlers that are in that year, for each year list remove the first 5 characters and then do a numeric sort by everything before the first / in what is left to get the year grouped into months and split that into individual lists for months, than in each month split out the day second and sort by that. Then using the orders discovered in each part rebuild the original list.

Mark S.

unread,
Mar 6, 2018, 10:34:48 AM3/6/18
to TiddlyWiki
Use a separate field for sorting. Trying to make the title field do 5 jobs (title, id, date, sort, hidden) is just too much.

Riz

unread,
Mar 6, 2018, 11:17:15 AM3/6/18
to TiddlyWiki

j3d1H

unread,
Mar 6, 2018, 9:31:25 PM3/6/18
to TiddlyWiki
Thank you, Riz! That works perfectly!

Riz

unread,
Mar 6, 2018, 10:00:48 PM3/6/18
to TiddlyWiki
The filter will become part of core in version 5.1.16. Once it comes out, you can upgrade and remove the plugin

Michael Wiktowy

unread,
Mar 9, 2018, 4:33:12 PM3/9/18
to TiddlyWiki
On Tuesday, March 6, 2018 at 10:00:48 PM UTC-5, Riz wrote:
The filter will become part of core in version 5.1.16. Once it comes out, you can upgrade and remove the plugin

Along with un-zero-padded dates, I did a quick test on the prerelease and the sortan filter seems like a perfect solution to my issue with sorting and unstable subsorting of CFR chapter titles (§1.10.100 (a)(1)) ... at least until they hit roman numerals ... but I'll take what I can get.

Thank you! This is awesome work. I'm looking forward to 5.1.16.

/Mike
Reply all
Reply to author
Forward
0 new messages