I’ve included date:: <% await tp.system.prompt("Date") %> in my template which prompts to enter a simple string which will be inserted into the note when Templater runs.
What I’m trying to do
I have a folder template configured with Templater for meetings. In it, I want to include the date of the meeting. The date of the meeting is usually today but sometimes I create a meeting note in advance (e.g. if I want to build an agenda). Ideally I’d like to parse the date from a natural language date (e.g. @Today). I have the NLD plugin installed which has a hotkey action to parse and insert a natural language date. Is it possible to access any APIs from the Natural Language Date plugin to make this possible?
Perhaps you’re making things more difficult than they need to be. How about instead just having the prompt for the date default to the current day, since that is your most common need?
Note, this uses the default format of ‘YYYY-MM-DD’ for the date, so if you did this for today it would show 2022-08-12 in the default value of the prompt (which you can change if desired). If you prefer a different date style then you could supply a format string as a parameter to the now function. For example:
You’re probably right–that’s what I was doing to start. It might sound silly but I use different date systems for work and non-work scenarios and sometimes mix up the month-date order , which I why I love using natural language dates. I ended up writing a user script which prompts for input and parses the NLD format, which is probably a bit brittle since it relies on the NLD plugin’s implementation but it works for my case for now.