Generating a weekly report of Journal tiddlers.

120 views
Skip to first unread message

Jeff Vance

unread,
Jul 29, 2016, 2:24:17 AM7/29/16
to TiddlyWiki
Hey all,

I'm trying to figure out how to automatically generate weekly reports from Journal tiddlers.  I can't quite figure out how to make it work and hoping some people have ideas here.  I can think of maybe 2 ways to do it and I'm not sure which is best.  

First idea:
When creating a new Journal entry, have it calculate the week number from the date, then add this to a field in the tiddler.  Then at the end of the week, create a weekly tiddler that uses a filter to link (or transclude) all the journal entries with the same week number field entry.  I know how to do all of these steps except the first one:  how can you change the New Journal operation to automatically assign a week number to a field?

Second idea:
Maybe instead of trying to assign week numbers directly to the fields, figure out the week number later by using the standard "created" field (or by the title field which has the date).

So which of these is likely to work better (or easier to do?)  (or is there another way that's even better?)  Thanks!


Jed Carty

unread,
Jul 29, 2016, 3:47:49 AM7/29/16
to TiddlyWiki
I don't know anything that currently lets you get the week number. I am pretty certain that to do this you will need to use some javascript. I have some javascript macros that can be used for generating different parts of the date here. I don't think that any will help you without modification, but they can be a start.

I think that the work that I am doing with twederation will soon be at a point where I need to add some more sophisticated date handling options for sorting so there may be updates to the date macros at some point, but I am not sure how soon.

Birthe C

unread,
Jul 29, 2016, 6:44:57 AM7/29/16
to TiddlyWiki
Hi Jeff

Change new journal button.

this part:

<$action-sendmessage $message="tm-new-tiddler" title=<<now "$(journalTitleTemplate)$">> tags="$(journalTags)$" week=<<now WW>>/>



This will give you the week field


Birthe

PMario

unread,
Jul 29, 2016, 6:59:59 AM7/29/16
to TiddlyWiki
On Friday, July 29, 2016 at 8:24:17 AM UTC+2, Jeff Vance wrote:
Hey all,

Hi Jeff
 
First idea:
When creating a new Journal entry, have it calculate the week number from the date, then add this to a field in the tiddler.  Then at the end of the week, create a weekly tiddler that uses a filter to link (or transclude) all the journal entries with the same week number field entry.  I know how to do all of these steps except the first one:  how can you change the New Journal operation to automatically assign a week number to a field?

IMO that's not the best idea because of this: https://en.wikipedia.org/wiki/Week#Week_numbering 
As you can see, the week numbering depends on the area, where you live. So if you feld is "hardcoded" it may be wrong.

TiddlyWiki atm stores the created and modified fields in this format: YYYYMMDDhhmmssms UTC format

So a tiddler created at Vienna at 12:50  2016-07-29 has a created field like this: 20160729105002497
You can see the difference in hh:mm ??  Vienna is UTC+2

So in my opinion, the week needs to be dynamically calculated, based on "created" and "modified". ... BUT this should be part of the core, to make it right and easy to use.

Second idea:
Maybe instead of trying to assign week numbers directly to the fields, figure out the week number later by using the standard "created" field (or by the title field which has the date).

IMO the right way. ... but may need some help from TW.
 
So which of these is likely to work better (or easier to do?)  (or is there another way that's even better?)  Thanks!

IMO It needs to be done right! ... Everything else will cause trouble in the future.

I'll have a closer look!

have fun!
mario

PMario

unread,
Jul 29, 2016, 7:03:09 AM7/29/16
to tiddl...@googlegroups.com
On Friday, July 29, 2016 at 12:44:57 PM UTC+2, Birthe C wrote:

<$action-sendmessage $message="tm-new-tiddler" title=<<now "$(journalTitleTemplate)$">> tags="$(journalTags)$" week=<<now WW>>/>

Hi Birthe,

I did forget about the <<now>> macro. ... good catch :) .. but still I think, it should not be hard-coded. .. too many problems.

-m

PMario

unread,
Jul 29, 2016, 7:05:18 AM7/29/16
to TiddlyWiki

On Friday, July 29, 2016 at 12:44:57 PM UTC+2, Birthe C wrote:
<$action-sendmessage $message="tm-new-tiddler" title=<<now "$(journalTitleTemplate)$">> tags="$(journalTags)$" week=<<now WW>>/>

WW imo needs to be 0WW. Otherwise sorting will fail. eg: week 1, 10, 2, ..

-m

Birthe C

unread,
Jul 29, 2016, 7:35:56 AM7/29/16
to TiddlyWiki
Thank you PMario!

You are of course right! I did not know about the differences in weeknumbers either. Love this, always something to be learned.


Birthe
Reply all
Reply to author
Forward
0 new messages