Having issues with some commands not executing in read mode.
Does anyone else have the same issue and solved it?
Example:
created date: <% tp.date.now("YYYY-MM-DD HH:mm") %>
modified date: <% tp.file.last_modified_date("YYYY-MM-DD HH:mm") %>
Having issues with some commands not executing in read mode.
Does anyone else have the same issue and solved it?
Example:
created date: <% tp.date.now("YYYY-MM-DD HH:mm") %>
modified date: <% tp.file.last_modified_date("YYYY-MM-DD HH:mm") %>
A template command is usually only resolved when you execute it manually via “insert template” and is not refreshed. However, the templater plugin gives you such an option when you add a +
sign - see this description.
That is what I am figuring out it only works if you are using a template to create a new note.
You can’t add this to an existing note which is what I want to be able to do.
Dang!!
That’s how templates work!
But I pointed you to the solution, so why don’t you try this?
You can insert templates into existing notes.
@anon63144152 yeah, of course you can - but I understood that what the OP wants is, for example, a modification date that self-updates with every modification. And for this to work, the line modified date: <% tp.file.last_modified_date(“YYYY-MM-DD HH:mm”) %>
has to be changed:
modified date: <%+ tp.file.last_modified_date() %>
(note the added +
)
Hello, @alltagsverstand
Absolutely. I was replying (inexpertly) to this line:
Could also use this (or similar), depending on the plugins used:
**Created**:
`=dateformat(this.file.ctime, "yyyy-MM-dd-EEEE, HH:mm")`
**Modified**:
`=dateformat(this.file.mtime, "yyyy-MM-dd-EEEE, HH:mm")`
Apologies, @alltagsverstand, if I was clumsy in my post.
FWIW, I see the NaN
error when running the dynamic command. Seems to be a current, unresolved bug:
When you post code, it helps to mark it as code, like this:
~~~
created date: <% tp.date.now("YYYY-MM-DD HH:mm") %>
modified date: <% tp.file.last_modified_date("YYYY-MM-DD HH:mm") %>
~~~
You can use tilde (~
) or backtick (`). (I used tilde because it’s easier to type on my tablet.) i did in for you in the main post.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.