[TW5] Applying BJ's Calendar Macro into Timeline macro

204 views
Skip to first unread message

Changhoon Lee

unread,
Oct 27, 2015, 11:14:45 AM10/27/15
to TiddlyWiki
I am thinking it would be nice to see timeline macro in a calendar style like BJ's Calendar Plugin. For example, If I set date field paramater to 'modifed', and click certain date in generated calender, then it shows list of tiddlers modifed on that date. I do not really have Javascript knowledge, so I was not able to make this happen. As far as I know, the BJ's calendar.js can be extended by javascript called 'formatter'. Could someone please help me on this. :) Thank you.

Lee

Tobias Beer

unread,
Oct 27, 2015, 11:39:14 AM10/27/15
to TiddlyWiki
Hi Lee,

Can you please (always) link any references you mention? Thanks :-)

Best wishes,

— tb

BJ

unread,
Oct 27, 2015, 12:29:29 PM10/27/15
to TiddlyWiki
Hi Lee,
there is also another calendar plugin that use tiddlytext instead of JS - http://inmysocks.tiddlyspot.com/, may be it would be better to look at this? Do come back with any questions,

all the best

BJ

Jed Carty

unread,
Oct 27, 2015, 1:43:25 PM10/27/15
to TiddlyWiki
If you look at my non-reference site here the calendar archive does almost exactly what you are asking for. When you click on a day it automatically generates a tiddler that lists tiddlers for that day. I should get it cleaned up so other people can use it reasonably. I am also partway through a major update to my calendar plugin. I am not sure how soon I will be able to finish the update though.

Changhoon Lee

unread,
Oct 28, 2015, 1:26:44 AM10/28/15
to TiddlyWiki
Thank you so much for the quick answer and the plugin.

I have imported your calendar tiddler and I did little tweak to list all tiddlers created on the day
\define thisBuildDayTiddlerText()
<$list filter="[!is[system]regexp:created[^$(Year)$$(Month)$$(Day)$]]">
<$link to={{!!title}}><$view field="title"/></$link>
<br>
</$list>
\end
There's just little problem. The $(Day)$ variable does not come with leading zero
How do I make it to create 'regexp:created[20151001]' instead of 'regexp:created[2015101]'?
 
 
2015년 10월 28일 수요일 오전 4시 43분 25초 UTC+11, Jed Carty 님의 말:

Changhoon Lee

unread,
Oct 28, 2015, 1:28:19 AM10/28/15
to TiddlyWiki
I will make sure I will put reference links next time. Thanks :)

2015년 10월 28일 수요일 오전 2시 39분 14초 UTC+11, Tobias Beer 님의 말:

Changhoon Lee

unread,
Oct 28, 2015, 1:30:36 AM10/28/15
to TiddlyWiki
Thank you so much for the introducing plugin. It works great for me and only problem I am having at the moment is that leading zero problem mentioned above. :)

2015년 10월 28일 수요일 오전 3시 29분 29초 UTC+11, BJ 님의 말:

Jed Carty

unread,
Oct 28, 2015, 4:58:36 AM10/28/15
to TiddlyWiki
I hadn't really considered the problem of leading zeros. The javascript would need to be modified to allow a leading zero on the day or month inputs. It shouldn't be a big change but it may be a while before I get around to fixing it.

In the meantime you may be able to use this filter instead:

\define thisBuildDayTiddlerText()
<$list filter="[!is[system]has[created]get[created]removeprefix[$(Year)$$(Month)$]]+[removeprefix[$(Day)$]][removeprefix[0]removeprefix[$(Day)$]]">

<$link to={{!!title}}><$view field="title"/></$link>
<br>
</$list>
\end

The remove/add prefix/suffix filters are very powerful in some sitations.

You may need to do a similar thing for months before october, so you may need to use the filter:

[!is[system]has[created]get[created]removeprefix[$(Year)$]]+[removeprefix[$(Month)$]][removeprefix[0]removeprefix[$(Month)$]]+[removeprefix[$(Day)$]][removeprefix[0]removeprefix[$(Day)$]]


Changhoon Lee

unread,
Oct 28, 2015, 7:47:28 AM10/28/15
to tiddl...@googlegroups.com
Thank you so much for the code Jed.
 
\define thisBuildDayTiddlerText()
<$list filter="[!is[system]has[created]get[created]removeprefix[$(Year)$$(Month)$]]+[removeprefix[$(Day)$]][removeprefix[0]removeprefix[$(Day)$]]">
 
<$link to={{!!title}}><$view field="title"/></$link>
<br>
</$list>
\end
 
I have tried the code you suggested and it's giving me list of links with hour, minute, second, milisecond title only.

First 2 digits are hour, next 2 is minute and so on.
How can I change this to the title of tiddler? :)


 
2015년 10월 28일 수요일 오후 7시 58분 36초 UTC+11, Jed Carty 님의 말:
2015년 10월 28일 수요일 오후 7시 58분 36초 UTC+11, Jed Carty 님의 말:
2015년 10월 28일 수요일 오후 7시 58분 36초 UTC+11, Jed Carty 님의 말:

Jed Carty

unread,
Oct 28, 2015, 3:40:48 PM10/28/15
to TiddlyWiki
Oh, sorry about that. The easiest fix would be:

\define thisBuildDayTiddlerText()
<$list filter='[!is[system]has[created]' variable=ThisTiddler>
<$list filter="[is[current]get[created]removeprefix[$(Year)$$(Month)$]]+[removeprefix[$(Day)$]][removeprefix[0]removeprefix[$(Day)$]]" variable=dummy>
 
<$link to=<<ThisTiddler>>><$view tiddler=<<ThisTiddler>> field="title"/></$link>
<br>
</$list>
</$list>
\end

Changhoon Lee

unread,
Oct 28, 2015, 9:54:32 PM10/28/15
to tiddl...@googlegroups.com
Thank you for the code again. I really appreciate your help.

I tested the code you suggested, and it's behaving in a strange way.
When I press the day in calendar, It creates tiddler without any list.
I entered edit mode and saved it again without changing anything
then, a list shows up and listing pretty much all tiddler I have(except system tiddler).

Since I encountered with UTC and timezone problem,
I decided not to proceed on this topic for now.

Thank you so much for the help though.





2015년 10월 29일 목요일 오전 6시 40분 48초 UTC+11, Jed Carty 님의 말:
Reply all
Reply to author
Forward
0 new messages