sameday[]

158 views
Skip to first unread message

Stefan Spycher

unread,
Nov 27, 2017, 3:45:51 PM11/27/17
to TiddlyWiki
I'm using tiddlywiki journaling extensively these days, and at the end of the week, i'd like to get an overview on all the created and edited tiddlers of any given past day.
the recent tab doesn't help much, because it's hardcoded to 100 days (don't wanna change that), and i'd like to have this overview in the daily journal tiddlers.

so, the thing i found is <$list filter=[sameday[20171127]]></$list>

but what i'm having a hard time figuring out is how i can substitude the hardcoded date to the 'created' date of the current tiddler (which is the daily journal tiddler, so it's create date is exactly what i could use)

long story short, how to use the <currentTiddler> created date in the correct format (YYYYMMDD) as date for the sameday operator?

thanks a lot!

Rob Hoelz

unread,
Nov 27, 2017, 4:06:03 PM11/27/17
to TiddlyWiki
Hi Stefan,

I have a little macro I wrote to get the current YYYY-MM; it would be trivial to adapt it to include the day of the month too!

Here's the macro:


I use it on my Journal tiddler to list journal entries for the current month, like so: 

{{{ [tag[Journal]prefix<yyyymm>sort[]reverse[]] }}}

-Rob

Rob Hoelz

unread,
Nov 27, 2017, 4:08:59 PM11/27/17
to TiddlyWiki
Another thought - you could probably use the "now" macro to do what you want: https://tiddlywiki.com/#now Macro

Eric Shulman

unread,
Nov 27, 2017, 4:10:13 PM11/27/17
to TiddlyWiki
On Monday, November 27, 2017 at 12:45:51 PM UTC-8, Stefan Spycher wrote:
so, the thing i found is <$list filter=[sameday[20171127]]></$list>
but what i'm having a hard time figuring out is how i can substitude the hardcoded date to the 'created' date of the current tiddler (which is the daily journal tiddler, so it's create date is exactly what i could use)
long story short, how to use the <currentTiddler> created date in the correct format (YYYYMMDD) as date for the sameday operator?

You can use any valid date **field reference** (i.e., {!!created} or {!!modified}) as the parameter value.  You can also specify an operator *suffix* to indicate which field to compare with.

Note that, as per the documentation for the sameday filter: "D may include a time of day, but this is ignored."

Thus, for your use-case:
<$list filter="[sameday:created{!!created}] [sameday:modified{!!created}]">
<li><$link><$text text=<<currentTiddler>>/></$link></li>
</$list>

Note the use of two concatenated filter expressions to select tiddler by "created" OR "modified" field value matching the current tiddlers "created" date.

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals

Mark S.

unread,
Nov 27, 2017, 5:23:14 PM11/27/17
to TiddlyWiki
This date thing is always confusing. Won't using !!created rather than <$view...> result in a date that will be off by some number of hours from UTC? People at ground zero UTC won't notice, but people further away will.

On another note, has anyone noticed that there might  be a problem with sameday in 5.1.15?

This code:

<<list-links "[sameday[20171127]]">>

works in 5.1.14 but not in 5.1.15. To make it work, you have to add an hour field:

<<list-links "[sameday[2017112726]]">>

Notice that this works despite the nonsensical Hour 26.

I looked through the release notes, but didn't see anything relating to sameday.

-- Mark

TonyM

unread,
Nov 27, 2017, 6:27:09 PM11/27/17
to tiddl...@googlegroups.com
Mark et al,,

On the subject of dates is their a method to transform a date in the form YYYY0MM0DD or similar into date serial number?
'

Actually I have tiddlers with the tittle YYYY/0MM/0DD I would like to convert to date serial numbers as well.

Thanks in advance
Tony

TonyM

unread,
Nov 27, 2017, 7:39:12 PM11/27/17
to TiddlyWiki
Answered my own Question

Dates with hyphens YYYY-0MM-0DD can be treated as valid dates so if maintained in this format no conversion is necessary.

I was using a YYYY/0MM/0DD format so I could use the Tree macro, but instead I made a new macro called a hyphentree, now I am working on another called a date tree to provide a clickable tree of all date named tiddlers.

Regards
Tony

Stefan Spycher

unread,
Nov 28, 2017, 2:29:53 AM11/28/17
to TiddlyWiki
thought of that too. but the <<now>> macro does exactly what it implies: whenever you refresh the page, <<now>> refreshes too, to the current timestamp. this isn't helpful if - in my use case - one wants to go back a few days and check the created & modified tiddlers of that day in the past.

Stefan Spycher

unread,
Nov 28, 2017, 2:43:36 AM11/28/17
to TiddlyWiki
@all: you guys rock! thanks a lot for your help!

for the record, i went with Erics suggestion:

<ul>

<$list filter="[sameday:created{!!
created}] [sameday:modified{!!created}]">
<li><$link><$text text=<<currentTiddler>>/></$link></li>

</$list>
</ul>

@Eric: the

[sameday:created{!!created}]

-notation is what i couldn't come up with, literally in hours....
I'm still trying to understand where i missed the part in the docs where this would have been described.

anyway, thanks, you made my day.

Stefan

Eric Shulman

unread,
Nov 28, 2017, 3:34:13 AM11/28/17
to TiddlyWiki
On Monday, November 27, 2017 at 11:43:36 PM UTC-8, Stefan Spycher wrote:
@Eric: the

[sameday:created{!!created}]

-notation is what i couldn't come up with, literally in hours....
I'm still trying to understand where i missed the part in the docs where this would have been described.

Reply all
Reply to author
Forward
0 new messages