Thanks to Eric Shulman's reply to jn.pierr.. question in "chaining jobs", I 
was able to fix the issue with the following changes: 

\define button_actions() <$action-setfield $tiddler=<<currentTiddler>> 
due=<<next-date 10>> />
<$button actions=<<button_actions>>> Set Interval
</$button>

Now the only thing left to do is to figure out how to set the interval 
based on field values.

On Friday, May 7, 2021 at 3:28:00 PM UTC+3 Pekka wrote:

> I have tried to search for answers to this questions but most of them were 
> years old and seemed rather complex. It seems to me that by now there would 
> exist a simple solution.
>
> I have a simple JavaScript code that takes a number representing an 
> interval and calculates the current date + interval. The below code will 
> output the next date correctly in a tiddler text field but I am unable to 
> plug this value into a tiddler field.  
>
> ---
>
> \define getNextDate()
> <$macrocall $name="next-date" interval=5 />
> \end
>
> <<getNextDate>>
>
> ---
>
> I have tried the below method to store the output into a field. The 
> confusing part is that both the <<date>> and <<getNextDate>> work fine in 
> the text field and even though <<date>> outputs the date in the text field, 
> the value that is set to the field "due" will be just "<$macrocall 
> $name="next-date" interval=5 />".
>
> <$set name="date" value=<<getNextDate>>>
> <<date>>
> <$button>
> <$action-setfield $field="due" $value=<<date>>/>
>
> Set interval
>
> </$button>
> </$set>
>
> Any help would be greatly appreciated!
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5eee2c79-0960-4ee2-a633-c448de13d563n%40googlegroups.com.

Reply via email to