On Tuesday, February 4, 2020 at 1:19:11 PM UTC-8, Aaron Haslem wrote:
>
> I want to display the contents of a field and the date that it was last
> modified. Displaying the field contents I understand. But, is there a way
> to display when a field was last modified? I know I can display the last
> modified date of a tiddler. If there isn't a way, what would be the best
> way of updating a date field associated with a field?
> For example. I have a field called Revision. I use the edit-text widget
> and button widget to update Revision. Is there a way to update a RevDate
> field that would populate with todays date whenever Revision is modified?
>
The $action-setfield widget can update more than one field when pressed.
Thus, for your edit-text and button combination, you could write:
\define setrev() <$action-setfield $tiddler=<<currentTiddler>>
rev={{$:/temp/revinput}} revdate=<<now "YYYY0MM0DD0hh:0mm:0ss">> />
<$edit-text tiddler="$:/temp/revinput" tag="input" default="" />
<$button actions=<<setrev>>> set revision </$button>
Note: use the actions=... button parameter to invoke the action-setfield
widget. This allows the value of revdate to be calculated each time the
button is pressed.
enjoy,
-e
--
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/6f942030-2eac-4196-9ebb-e72f4be17b3a%40googlegroups.com.