In Subtitle, only show modified date if N days later than created date

I’m trying to tidy up what’s shown on my wiki. I currently show the created and modified dates in the subtitle tiddler. What I’d like to do is show the created date, but then only show the modified date if it’s some number of days later than created.

The idea is that showing the same date twice is unnecessary, so I’d like to only show the modified date if it’s later than the created date. In fact, since I often tweak or add to a tiddler for a few days after creating it, I’d like to only show modified if it’s “enough” later for the modification to have been meaningful.

That “meaningful” bit is also tricky. Sometimes I’ll fix a typo in something months later. In this case I’d also not want to display the modified date. Perhaps we should ignore that for now :slight_smile:

How would you approach the conditional “only display modified if it’s more than 10 days later than created date” in a template/subtitle? I’ll address the “meaningful change” issue later if needed.

The example at the bottom of https://tiddlywiki.com/#DateFormat shows how to calculate the difference in days between the two. You should be able to use that to hide or show the modified field.

This is one attempt:

ModifiedAfter5Days.json (833 Bytes)

Well, that seems to have worked just fine. Thanks for the pointer and example! I’ve been using TiddlyWiki for a long time, but I still get lost when I start wandering off into the weeds.

Thanks again. I’ll learn a lot from it.

1 Like

Just for completeness.

The days operator can also achive this by comparing the two dates and there may be other approaches.

1 Like