Templater icon indicating copy to clipboard operation
Templater copied to clipboard

Offset for weekdays only?

Open patrickcjwall opened this issue 3 years ago • 2 comments

Hi! Thanks so much for this awesome plugin. It makes my life easier every day.

Is it currently possible/could it be possible to offset without counting the weekend? I have a few templates that link to tomorrow's documents (such as daily note) and it would be super cool to have the option of having them link to Monday's documents on a Friday, for example.

Thanks!

patrickcjwall avatar Jun 23 '21 14:06 patrickcjwall

If you link your templates, we could add some code to implement that function.

welpdx avatar Jun 28 '21 19:06 welpdx

You can use the following snippets:

Previous workday: <% tp.date.now('YYYY-MM-DD', tp.date.now('d') == 1 ? -3 : -1) %> Next workday: <% tp.date.now('YYYY-MM-DD', tp.date.now('d') == 5 ? 3 : 1) %>

razetdinov avatar Jan 16 '24 13:01 razetdinov