How do I insert relative date/time in notes?

I have a template that includes a custom span of dates. At this moment, in the body of the note all I can do is manually adjust it to the dates I need, but it would be nice to have Joplin do it for me.

More specifically, I want to have the first date be one day less than the current date and the last date, 7 days earlier. This is the template date format I am using now. It is the first line of the template:

Weekly review {{#custom_datetime}}Y.MM.DD-1{{/custom_datetime}} - {{#custom_datetime}}Y.MM.DD-7{{/custom_datetime}}

At this moment, the above template creates the relative date for the Name of note, but not in the body of the note:
Note name: Weekly review 2020.08.09 - 2020.08.03
Note body: Weekly review 2020.08.10-1 - 2020.08.10-7

2 Likes

I know this is kind of an old thread, but is this possible in Joplin? I've also played around with it but didn't get far. Ideally, I would like to combine this with a search s.t. I can get all open ToDos with a due date that is 7 days from the current day.

It's possible to type relative date using Slash Command Plugin

Just type /date-1 to get yesterday and /date-7 for 7 days earlier.

I don't know about the search with relative data though

1 Like

For searching relative dates, you may use the plugin Inline Tag Navigator. For example, a search for the range #today -> #today+7 would return all tagged lines with dates matching the coming week (e.g., any line where #2024-07-28 appears).

With search filter it is possible: due:day+7 iscompleted:0

You can automatically get all open todos due 7 days from today by installing the Note Overview plugin, then adding this content into a note:

<!-- note-overview-plugin
search: -due:day+8 iscompleted:0
fields: todo_due, title
alias: todo_due as Due Date, title as Todo
sort: todo_due ASC
-->

The above content generates and regularly updates a table of todos and due dates below it.

@JackGruber That should be -due:day+8 since due:day (or due:day+0) returns nothing and -due:day+1 returns todos due today.

1 Like

Thanks for your reply!

But is it also possible to search relative to a specific date (instead of today)? I want to add the search query to my daily journal template, and search open todos relative to the date it was created. This date should then not be updated when updating the note overview on another day.

The following does not work:

due:2024-07-21+7 iscompleted:0

I did some more research and an alternative would be to put the time offset into the template itself.

Apparently this is supported on the master branch but there hasn't been a release since. So maybe I will try to build the plugin locally and report back whether this works.

Edit: Can't get the plugin to build, but I'm also not experienced with web development. But could someone comment on what's blocking a release of the template plugin?

I was already quite annoying...

Looks like the devs don't have time/a new release doesn't have a high priority on their ToDo list

1 Like