How to get bjtools Extendable Calendar to display the contents of a field

@buggyj May I ask how do I get bjtools Extendable Calendar to display in each calendar square the contents of a field (for instance “journal-synopsis”) from any tiddler whose journal-date field date matches the calendar square for that date?

For instance, assuming <<diary “2024” “5”>>, the calendar square for May 8 would show the contents of the journal-synopsis field from any tiddlers whose journal-date field contents started off “20240508…”

I was looking through the plugin tiddlers but don’t know which one to change.

See here for how to using a wikitext macro with the calendar, you should be able to include a filter to get your data into the calendar.

https://bjcalendarext.tiddlyhost.com/

OK, I’m trying to follow along, and I admit to being baffled trying to follow the customdate macro… (UPDATE: I found where testtid is specified…)

Remaining mystery — surely a bug: How could 201422 possibly count as a valid date string for February 2 2014 (and 2014219 for February 19, etc.?)?

So I tried using 2014111, and sure enough, the macro is confused. Contents of a field by that name show up for Jan 11 AND for Nov 1:

@BuggyJ Thank you so so much for opening a portal.
@Springer Thank you so so much for finding testtid. I was UTTERLY mystified until I saw your post.

To experiment I changed testtid

  • gave it the field journal-date with the value of 20240508000000000
  • gave it the field journal-day-summary with the value of Climbed Mount Everest.
  • I tagged it with Journal

Changed the diary to <<diary 2024 "5" >>

I was hoping to see “Climbed Mount Everest” show up in the May 8 square, but of course nothing did because I see I must change the macro in the customdate tiddler somehow.

Will continue experimenting.

(Update)
I forgot to say I deleted the two original fields: 2014219 and 201422 because I only want the calendar to look at the journal-date field for the date.

Yer, the example is not so good… In the example the wikitext macro is passed the month and day as a simple number, so the 1st is just a ‘1’, maybe better to give the day as two digits eg ‘01’, and the same for the month?

1 Like

@Springer, @Sapphireslinger I have just remember that I updated the calendar a couple of years ago to include this type of use, see My TiddlyWiki — a non-linear personal web notebook. I will update the demo with the latest version.

see new example https://bjcalendarext.tiddlyhost.com/

1 Like

@buggyj WOW, thank you!

However this form of it does not work: <<newdiary "2024" "5">>

(I am putting the calendar in a tiddler for May 2024, so I used <<newdiary “2024” “5”>> to make sure that only May 2024 would show there for all time, but it no longer shows “Climbed Mount Everest.” in the square.)

The definition of diarydets needs to be in the same tiddler as the wikitext <<newdiary "2024" "5">> (or imported via \import), or defined as a global macro.

You also need the latest version of the calendar plugin (currently 2.2.0 - as used in the demo wiki) .

It’s possible to create more sophisticated applications. I have included another example that ‘pops up’ the journal entry in the demo wiki. My TiddlyWiki — a non-linear personal web notebook

1 Like

I have updated the macro to the current version 2.2.3 - I needed to remove a demo file blocking the global macro

Cool, this behaves more intuitively now.

For example, you can easily get a responsive custom month-view this way (tucking the desired month and year values into a field):

Year: <$edit-text field="year"/>
Month: <$edit-text field="month"/>

<$macrocall $name="newdiary" year={{!!year}} month={{!!month}}>>

Hi @buggyj, I wonder whether I could nudge you to make one further tweak to your javascript macro.

It currently creates a table with wikitext pipes, which may be fine (my impression is that some here recommend html tags for tables that can get complex, but I’m not sure what’s at stake in that)… Certainly, your plugin is light and relatively easy to reverse-engineer!

However, as far as I can tell, the only way to style the calendar, currently, is to cast such a wide net as to restyle all tables in the wiki:

table {width:100%; }
table * th {background-color: <<colour tab-background>>;}
table * td {width:5em; height: 2em;}

Splicing in a class for the calendar tables such as
|calendar|k
would enable people to target the calendar tables for styling.

Even better would be letting the table class be specified as a further parameter of the macro (!), since that way one could specify, with css alone, that certain details should be hidden. For example, a calendar in the sidebar could be invoked with cal-minimal class, etc.)

Is this an easy tweak?

@buggyj Thank you so much for giving us all these calendar options. It is such a good feeling having a way to look back at one’s whole life in a glance with this calendar.

Hope you can link to all these examples on the main BJ Tools site, so that other amateurs like me can find them.

@Springer Thank you for your help even while being a busy teacher. If you ever wrote an article on time management, I would read it.

@Springer I wrote the calendar plugin back in Jan 2014 it was my first attempt at TW5 coding. It is very different to how I write stuff for TW now. But as you say it is very ‘light’ and easy to read… I have added in the classes I will make a new release soon.

2 Likes

I’m afraid part of my time-management “expertise” is that when I want to take a break from the conceptually messy challenges of my day-job — which is often enough! — I come hang out at this forum. :stuck_out_tongue_winking_eye: