List tiddlers created or modified since reference tiddler's modified timestamp

Is there a way to get all non-shadow tiddlers that were created or modified since “tiddler A” was modified? I tried to go through the list operators, but nothing stood out. I am assuming what I want is the days operator, but I am just not getting beyond that.

<!-- you can do that with the magic of functtions.  -->
<!-- map.getdate gets the date from the result of [!is[shadow]]   -->
\function map.getdate(field)[<currentTiddler>get<field>]
<!-- comparedates enables tthe test to be done against both created and modified   -->
\function comparedates(tiddler)[<tiddler>get[created]compare:number:lt<map.getdate created>then<currentTiddler>] ~[<tiddler>get[created]compare:number:lt<map.getdate modified>then<currentTiddler>]

{{{
  [!is[shadow]]
  :map[<comparedates 'tiddler A'>]
}}}

note, calling the functions like above is not the normal way to use functions. calling functions using macro syntax like this will only return one result, but for our purpose this is desirable.

Here’s a really simple filter to get the list you want:

{{{ [sort[modified]allafter[tiddlerA]] }}}

The above code displays a list of links to the matching tiddlers. If, instead, you want to capture this list for further processing, you would use the $set widget, like this:

<$set name="tids" filter="[sort[modified]allafter[tiddlerA]]">

Note that in these filters, I have omitted an initial all[tiddlers] operator, since it is implied whenever the first operator in a filter is a “filter modifier” (i.e., an operator that expects a list of items as input).

enjoy,
-e

1 Like

Thanks @VikingMage and @EricShulman

@EricShulman, your filter worked like a charm. It had to be simple for my use case - I intend to use it through the web server API, so this notation works really well.

Thanks again