Back to winter 2019, when we were working on the Commander plugin we needed
a comparison between two tiddlers to see which is greater. See [1]
The best solution we found (by BTC) at that time was as below [2] (still
works and is part of Commander)
<$set name="tidBMod" value={{{ [[Bb]get[modified]] }}}>
<$set name="tidAMod" value={{{ [[Aa]get[modified]] }}}>
<$list filter="[<tidAMod>] [<tidBMod>]
+[nsort[]last[1]removesuffix<tidAMod>]">
Yes, Aa is newer
</$list>
<$list filter="[<tidAMod>] [<tidBMod>]
+[nsort[]last[1]removesuffix<tidBMod>]">
No, Aa is older
</$list>
</$set>
</$set>
With the advent of many new filter operator, I want to know if there is a
shorter and more semantic solution can be found today Apr 2021
I thought about the below solution and it works in TW 5.1.23
<$vars dtb={{{[[Bb]get[modified]]}}}>
<$list filter="[[Aa]get[modified]compare:integer:gt<dtb>then[Aa]else[Bb]]">
<<currentTiddler>> is newer!
</$list>
</$vars>
But I am wondering if we could use :filter or some other operator to drop
the $vars and dtb and perform the comparison in single $list
Note Aa and Bb are two tiddlers
Best wishes
Mohammad
[1] https://groups.google.com/g/tiddlywiki/c/9QQvkJkLogA/m/3AGSBBJKBgAJ
[2] https://groups.google.com/g/tiddlywiki/c/9QQvkJkLogA/m/UbIgaSFSBgAJ
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/CAAV1gMBqP4fLS%2B-eSuxYo5m%3D1BPQFpWh44uVm1yfNEKHuB9MPQ%40mail.gmail.com.