I'm sure others could do this far more efficiently, but in case it helps, 
here's a minimalist version of what I cobbled together using both the 
dateTime macro and Matabele's <mangletags> and <setfield> widgets 
(http://gwiz.tiddlyspot.com/#Widgets%20for%20Buttons:[[Widgets%20for%20Buttons]]).
 


In order to make this work, the tiddler needs to have three fields:
-repeattype (with a value of months or days, e.g., 1M, 2D, 7D, etc.)
-duedate (with a value formatted without hyphens, e.g., 20141124)
-due-date (with a value formatted with hyphens, e.g., 2014-11-24. This one 
isn't actually essential, but allows the date to be displayed in the 
tiddler.  Note that changes to this date don't affect the "duedate", but 
clicking the update button will re-align this date with the "duedate").
I couldn't figure out how to avoid the two date versions for my purposes, 
but at least you only need to set them up once.

The tiddler text (which can also be used in transclusion in any other 
tiddler that contains the three fields):

\define nextdeadline(duedate,repeattype)
<<dateTime "YYYY-0MM-0DD" "$(duedate)$" "$(repeattype)$">>
\end

\define nextunformatteddeadline(duedate,repeattype)
<<dateTime "YYYY0MM0DD" "$(duedate)$" "$(repeattype)$">>
\end

\define updatefields1(to, add2,add4, add5)

<$setfield set="$to$!!due-date" setTo=$(add4)$ >
<$setfield set="$to$!!duedate" setTo=$(add5)$>
<$mangletags message="tm-set-field"><$button  message="tm-mangle-tags">
update</$button></$mangletags></$setfield></$setfield>
\end

\define updatefields2()
<$macrocall $name="updatefields1" to={{!!title}}  add2=<<dateTime 
"YYYY-0MM-0DD">> >
\end

<$set name="duedate" value={{!!duedate}}>
<$set name="repeattype" value={{!!repeattype}}>
<$set name="add4" value=<<nextdeadline>> >
<$set name="add5" value=<<nextunformatteddeadline>> >

<$edit-text tiddler={{!!title}} field="due-date" type="date" tag="input"></
$edit-text>

<$list filter="[all[current]]"><<updatefields2>></$list>
</$set>
</$set>
</$set>
</$set>






cmari

On Monday, November 24, 2014 9:07:38 AM UTC-8, Andreas wrote:
>
> Hi cmari,
>
> the dateTime module could be what I was searching for - thanks for this.
>
> The usage is described like this:
> The variable "tag" hold the current date.
> <$set name="tag" value=<<dateTime "DD-MMM">>>
>
> One question I still have:
> How do I get the resulting date from the variable "tag" into my field 
> t_duedate?
> (Sorry if this question is to stupid...)
>
> Andreas
>
>

-- 
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 http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to