print list of date range

53 views
Skip to first unread message

Dave

unread,
Mar 3, 2020, 5:08:45 PM3/3/20
to TiddlyWiki
Is there a native way to print a list of dates for a specified date range, e.g.:

2020-03-03
2020-03-04
2020-03-05
2020-03-06
2020-03-07
2020-03-08
2020-03-09

Whereby they would show as links, even if they aren't currently a tiddler?


Thanks,

- Dave

TonyM

unread,
Mar 3, 2020, 6:06:16 PM3/3/20
to TiddlyWiki
Dave;

Ultimatly it depends on how you source these date names but perhaps this gives a clue?

<$list filter="

2020-03-03
2020-03-04
2020-03-05
2020-03-06
2020-03-07
2020-03-08
2020-03-09
">
<$link /><br>
</$list>

Regards
Tony

Dave

unread,
Mar 3, 2020, 6:32:27 PM3/3/20
to TiddlyWiki
Oh, sorry, I meant a programmatically derived list, something like a list from now to a week from now, or a list from a week ago to a week from now.

TonyM

unread,
Mar 3, 2020, 6:55:29 PM3/3/20
to TiddlyWiki
David,

Yes, I expected you may ask that. See How I raised something for this in the dev forum Propose: Simple date validation operator

I could see the answer is not so simple if you need to ensure valid dates, if you want to generate short date ranges like in your example it can be trivial

<$list filter="[range[.03,.09,.01]removeprefix[0.]addprefix[2020-03-]]">

</$list>
See how I use decimal numbers and remove prefix to have the result have a leading zero (below 10)

However personally I would keep dates as simple numbers
<$list filter="[range[.01,.31,.01]removeprefix[0.]addprefix[202003]]">

</$list>
because then you can ask if one is greater than the other and reformat it later
True YYYY-MM-DD can also be compared < >

The view widget can translate a value in a field into and date format you want to display it, leave the display format to the end where possible, as this maintains your choice and keeps it simple.

I still feel we need the ability to feed a date <variable> into the view widget.

Dave

unread,
Mar 3, 2020, 7:15:49 PM3/3/20
to TiddlyWiki
Thanks Tony!

Mark S.

unread,
Mar 4, 2020, 12:36:23 AM3/4/20
to TiddlyWiki
Here's another approach that can cross month boundaries. Well, I think it can:

TonyM

unread,
Mar 4, 2020, 1:45:36 AM3/4/20
to TiddlyWiki
It looks like it does,

It uses the aforementioned Date Conversion Macros are these published and extended from this example?

Regards
Tony
Reply all
Reply to author
Forward
0 new messages