Days since modified

51 views
Skip to first unread message

Stobot

unread,
Oct 9, 2017, 1:30:27 PM10/9/17
to TiddlyWiki
Hello all,

I'm using TW5 for some project management and trying to more easily find neglected projects. I have each Project have a tag "Projects", and each task under that project has the Project Title as a tag to link them together. The closest I've got is to return the actual modified field of the most recent task for each project using:

\define lastmodifiedtask() <$list filter="[all[current]tagging[]get[modified]sort[modified]last[1]]"/> 
(used within another list widget of project names)

...but that returns the full numeric value like "20171003145311358" which is hard to visually look at. 

In order of preference:
1. Can I return just a number of how many days it's been since the date provided? (6 for example)
2. If not, is there any way to format the returned number to parse out just the month/day or something? (10/3 for example)
   a. I see in <$view.../> I have some date formatting options, but can't take the macro and put it in the view widget

Any help is greatly appreciated. Thanks!

Jed Carty

unread,
Oct 9, 2017, 1:48:01 PM10/9/17
to TiddlyWiki
You can put the view widget in the macro.

\define lastmodifiedtask() <$list filter="[all[current]tagging[]get[modified]sort[modified]last[1]]"><$view formate=date template='0dd/0mm'/></$list>

I made some macros to do this sort of thing here http://ooktech.com/jed/ExampleWikis/DateMacros/ but they aren't made to work with tiddlywiki timestamps. I should get around to updating that.

Stobot

unread,
Oct 9, 2017, 2:58:30 PM10/9/17
to TiddlyWiki
Awesome!

Note for later for myself/others that find this: didn't work until adding field=title within the <$view.../> section.

<$list filter="[all[current]tagging[]get[modified]sort[modified]last[1]]"><$view field=title format=date template="0MM-0DD"/></$list>


Reply all
Reply to author
Forward
0 new messages