Fistly, I have noticed that they are a lot of missing closing widgets (</$reveal>, </$set>, </$vars>, </$wikify>, …) as well as some </div> and @@ inside TiddlyTools/Time/Calendar. I do not know if this can lead to side effects or performance issues. If interested, I can share a version where I have tried to add all the missing items.
Secondly, I have two requests related to the elements display in the calendar:
Could the journal list and indicator be shown when there is a journal existing for a day, event if it was created another day?
Could the created and modified tiddlers list be activated independently (currently there is only one config option to display none or both)?
Thirdly, is it planned to have these tools proposed as a plugin ? The rationale behind this question is that:
I prefer to separate the wiki tools inside the “system namespace” from the “operational content” for display, search, …
The plugin may help with updates and tweaking. (The shadow mechanism allow to easily come back to the non tweaked version and tweaks can be shown with the diff preview).
By default, when the end of a macro definition is reached, any unmatched widgets, divs, etc. are automatically “closed” by the TWCore parser. Thus, it is not necessary to have lots of matching </$set>, </$vars>, etc., as long as the unmatched widgets are NOT enclosed inside another widget that DOES have a matching </$...>. This is not a problem and has been done deliberately in order to improve readability, reduce the size of the Calendar code, and make it easier to write macros that start with lots of <$set> and <$vars> widgets without worrying about having the correct number of matching close widgets.
This is a bit tricky…
The journal title format is configurable in the $:/ControlPanel. While this setting typically consists of a date format such as “YYYY 0MM 0DD”, it is not a hard-and-fast requirement.
For example, I can set the journal title format to “MMM YYYY” so that all journal entries for the same month and year will be added to the same tiddler, without any date information except for the tiddler’s “created” and “modified” fields.
As an even more extreme example, the journal title format could be something that doesn’t have ANY date formatting codes, such as “My Journal”, so that EVERY journal entry, regardless of the date, is added to a single tiddler.
It should be possible to extend the TiddlyTools Calendar’s journal creation button to add an extra “journaldate” timestamp field using the standard 17-digit zero-padded “system datetime” format – i.e., YYYYMMDD000000000 when creating a new journal, and then use this field value to enable the Calendar to show the journal entry and indicator on the specified “journaldate” instead of the “created” and “modified” dates.
Of course, the journal tiddler would still be listed as a regular “created” or “modified” tiddler using the date(s) specified by the actual created and modified fields of the tiddler. In addition, any journal tiddlers created outside of the Calendar code (e.g., by using the sidebar “new journal” or tiddler “new journal here” buttons, or possibly imported from another document) wouldn’t have the extra “journaldate” field, and thus would still be listed as a journal using the created or modified field values.
I’ll work on this and let you know when I have something for you to try.
It should be possible to add checkboxes under “[x] show tiddler changes” and “[x] show system changes” to separately choose “[x] created” and/or “[x] modified”, with the default being to show both. I suppose it would also be nice to support optional color choices to differentiate them visually in the “color bar”, with the default being to use the same color (i.e., as they currently appear).
Again, this will take some work to accomplish, and I’ll let you know when I have something for you to try.
I am not currently packaging these tools as a plugin, but it is possible to do so. You can even do this yourself with just a few steps! Here’s how:
Begin by dragging the desired TiddlyTools/Time/* tiddlers into your document.
When the $:/Import tiddler is displayed, instead of pressing the “import” button, EDIT THE $:/Import TIDDLER.
You will see a big block of JSON that contains the tiddler definitions.
Change the tiddler title from “$:/Import” to “$:/plugins/TiddlyTools/Time”
Scroll all the way to the bottom of the tiddler editor, and change the value of the plugin-type field from “import” to “plugin”. You can also delete the status field (which has a value of “pending”)
Press “done” (checkmark button) to finish editing.
That’s it. You now have installed shadow tiddler versions of “TiddlyTools/Time/Calendar”, etc. Note that, if you’ve installed anything that uses TiddlyTools/Time/action-timeout.js or TiddlyTools/Time/Ticker (a startup tiddler), you will need to save-and-reload your document for the new shadows to start working.
Well… it turns out that it was actually easier than I had thought!
It just took three relatively small changes to TiddlyTools/Time/Calendar:
showday_editjournal_actions(): add journaldate field when creating new journals
getjournals(): find journals by matching values in journaldate fields
showday(): allow journals to be listed under created/modified
Note that the journaldate field values use UTC (GMT+0) time values, just like the TWCore created and modified fields. As a result, the time stored in the journaldate field may be offset from the local time if you are not in the GMT+0 timezone. This offset will be important if you need to retro-fit existing Journal tiddlers by manually adding journaldate fields.
The easiest way to get the correct ‘journaldate’ values is to use 12:00 noon on the desired date (i.e., enter “YYYYMMDD120000000”). Since timezone offsets are always between -12 hours and +12 hours, using 12 noon avoids any “date wraparound” issues with hand-entered dates.
Eric this example reinforces my view the core jounaling should set a journal date field. Appart from allowing any title it allows creaded and modified to remain meaningfull. It also makes it possible to back date or future date journal.
I have modified buttons for this but no access to share them today. I must do a PR.
I belive you already showed us how to use a journal date with your timer tools.
I’ve successfully split the TiddlyTools Calendar “tiddler changes” handling into two separate items, each with their own color configuration. In the Calendar Settings popup, you can now select checkboxes for “show created” and “show modified”, which act as “parent” options for “include tiddler changes”, “include system changes”, and “include filtered changes” options.
The above journaldate logic was incorrect. Using UTC time values for the journaldate field resulted in the wrong date being produced if the current time was within the wraparound offset for the local timezone; e.g., here in California, the timezone offset is UTC-8… thus, if a journal tiddler was created after 4pm local time, the resulting time portion of the generated journaldate value would be early in the morning of the next day. But since the date portion of the journaldate value was being calculated separately using the “target” date from the calendar, it was still in the current day, and subsequent conversion to a UTC formatted datetime value caused the combined datetime to shift 8 hours earlier, which moved the result back to the previous day!
To resolve this, the journal timestamp generation now uses local time for all the calculations. This avoids any effects due to automatic adjustments for timezone offsets.