How to generate a list of dates for a droppable Timeline ...

146 views
Skip to first unread message

Jan Johannpeter

unread,
Aug 17, 2017, 10:07:37 AM8/17/17
to tiddlywiki
Hello,
I want to do a timeline to organize a course and assign dates to subjects.

I started using the TimelineMacros:

\define dropthisdate()
{{$currentTiddler$!!$dateField$}}
\end

\define droppable-date-actions()
<$wikify name="dd"  text=<<dropthisdate>> >
<$action-setfield $tiddler=<<actionTiddler>> $field="date" $value=/>
</$wikify>
\end

\define dropdate(limit:"100",format:"DD MMM",subfilter:"",dateField:"date",tag:"")
<div class="tc-timeline">
<$list filter="[!is[system]$subfilter$tag[$tag$]has[$dateField$]sort[$dateField$]limit[$limit$]eachday[$dateField$]]">
<div class="tc-menu-list-item">
<$droppable actions=<<droppable-date-actions>>>
<$view field="$dateField$" format="date" template="$format$"/>
</$droppable>
<$list filter="[sameday:$dateField${!!$dateField$}!is[system]$subfilter$!sort[$dateField$]]">
<div class="tc-menu-list-subitem">
<$link to={{!!title}}>
<<timeline-title>>
</$link>
</div>
</$list>
</div>
</$list>
</div>
\end

So far this does not work.

- How can I make <<dropthisdate>> to set the correct date (so far it just sets "true")

- Another approach would be even more practical: How can I generate a list containing all dates of the fridays from october to january (for example)in to put them in a field like this:
20180111230000000 20180118230000000

Cheers Jan

Mark S.

unread,
Aug 17, 2017, 12:13:26 PM8/17/17
to TiddlyWiki
The problem, I think, is that concatenation variables or parameters don't get passed more than one level. So you have to add them to the parameter call to the next macro you are calling. I added "dateField" to droppable-date-actions and it's invocation. After that the code becomes simpler, and you don't need the <$wikify>. This seems to work with

<<dropdate tag:HelloThere dateField:created>>

on the data at TiddlyWiki.com.

Code below.

Have fun,
Mark

\define droppable-date-actions(dateField)
<$action-setfield $tiddler=<<actionTiddler>> $field=$dateField$ $value={{!!$dateField$}}/>

\end

\define dropdate(limit:"100",format:"DD MMM",subfilter:"",dateField:"date",tag:"")
<div class="tc-timeline">
<$list filter="[!is[system]$subfilter$tag[$tag$]has[$dateField$]sort[$dateField$]limit[$limit$]eachday[$dateField$]]">
<div class="tc-menu-list-item">
<$droppable actions=<<droppable-date-actions $dateField$>>>

Jan

unread,
Aug 17, 2017, 6:40:12 PM8/17/17
to tiddl...@googlegroups.com
Thanks Mark, this really works fine...for the first part.

Is there a way to add seven days to a date given in a field. All the solutions I found work with the <<now>> macro or something similar. I would like to enter a start date and then generate a list of the further dates tipping on a button...

Thanks Jan
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
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/8de9e34d-39da-4818-b4f9-7c2ddb11bec6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Elmiger

unread,
Aug 18, 2017, 7:18:17 AM8/18/17
to TiddlyWiki
Hi Jan

Jed has some nice date-macros here http://ooktech.com/jed/ExampleWikis/DateMacros/ – one of them can add days to a given date …

Good luck!
Thomas

Jan

unread,
Aug 19, 2017, 11:54:12 AM8/19/17
to TiddlyWiki
Hi Thomas, (nice to read from you!)
unfortunately there just is a macro calculating the date from <<now>> on.

""It will be <<add-time 5 3 2>> 5 years 3 months and 2 days from now.""

I foiled thorough the group and could not find anything which I could adapt...
So now I am making use of the datepicker and a separate button to add the date generated by the datepicker to a list. Works but not very elegant. An "add same weekday in the next week button" would be better.../

I published my test and plugin on http://slidesnstories.tiddlyspot.com/#Datelist because it could be of use for anyone organizing courses.

And I got a further logical challenge there which I was not able to solve yet.

It would be nice...

...to ho have a list of all Tiddlers tagged by the storytiddler and do not have any of the values in the "dates"-field of the storytiddler in their "date"-field


Herzliche Grüße!
Jan



-------- Weitergeleitete Nachricht --------
Betreff: Re: [tw] Re: How to generate a list of dates for a droppable Timeline ...
Datum: Fri, 18 Aug 2017 04:18:17 -0700 (PDT)
Von: Thomas Elmiger <thomas....@gmail.com>
Antwort an: tiddl...@googlegroups.com
An: TiddlyWiki <tiddl...@googlegroups.com>
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Reply all
Reply to author
Forward
0 new messages