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