Hi
The tags may be modified more simply using the ActionListops widget -- the
entire code for the button is then:
<$button tooltip="This is done" class="todo-btn-invisible">
<$action-listops $tags="ToDoDone -ToDoNow"/>
<$action-setfield $field="todo-done" $value=<<now YYYY0MM0DD0hh0mm0ss>>/>
{{$:/core/images/full-screen-button}}
</$button>
regards
On Thursday, 18 August 2016 10:07:46 UTC+2, Thomas Elmiger wrote:
>
> Hi folks!
>
> While still learning TW in small steps, I am "developping" my own todo
> list … and ran into a problem: When a task is done, I want to write the
> done-date in it’s own field.
>
> Within the list of tasks I tried:
>
> <$set name="donedate" value=<<teTimestampNow>> >
> <$macrocall $name="todoBtnDone" remove="ToDoNow" date=<<donedate>>/>
> </$set>
>
> with these macros:
>
> \define todoBtnDone(remove, date)
> <$fieldmangler>
> <$button tooltip="This is done" class="todo-btn-invisible" message=
> "tm-remove-tag" param="$remove$">
> <$action-sendmessage $message="tm-add-tag" $param="ToDoDone"/>
> <$action-setfield $field="todo-done" $value="$date$"/>
> {{$:/core/images/full-screen-button}}
> </$button>
> </$fieldmangler>
> \end
>
>
> \define teTimestampNow()
> <$set name="timestamp" value=<<now YYYY0MM0DD0hh0mm0ss>> >
> <<timestamp>>000
> </$set>
> \end
>
> Problem: I can see the button (the button works actually and adds/removes
> tags as expected), BUT the output contains this as text output:
>
> <$action-setfield $field="todo-done" $value="
> 20160818095228
> 000
> "/>
>
> ... so it is not executed.
>
> I am sure I did something wrong with the variable values <<donedate>> and
> or $date$ – but I can’t see it at the moment. Maybe you can? Or is there a
> better way to get a timestamp in the same format as standard modified and
> created? Do I hav to use JS and $tw.utils.stringifyDate(now)); for this?
>
> Kind regards, Thomas
>
>
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/d99e2209-1c59-46bc-85cc-0390a535d4f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.