pup
September 26, 2023, 10:39pm
1
I’m using the “Templates” core plugin.
I’m trying to use template variables such as {{date}}
and {{time}}
as property values in a template file.
Is this standard practice?
If so, what is the correct way to format a template variable for a Date & time
property value?
I’ve seen many people suggest, {{date}} {{time}}
, but the Properties panel reports “Invalid properties.”
My best guess is {{date:YYYY-MM-DDTHH:mm}}
based on the end result and what the Properties panel seems to accept.
Thanks for your help.
5 Likes
I have the same exact question. I used to have a “date” line in the header info. After updating to the new version of Obsidian with properties, all my old files turned that into a “date type” property. But now I’m not sure how to include the {{date}} {{time}} variable in my template so that the date filed is automatically set when I insert the template into new notes
2 Likes
I was also wondering this, it was nice having the date inserted from my templates and now that’s broken.
1 Like
Actually apologies it just appears to work now?
I just have {{date}} in my template file
1 Like
student
November 17, 2023, 9:36am
5
Is there already a solution or open issue for this bug?
In my templates I use this line:
created: {{date}}
Switching to the preview mode I see this:
After editing another property in this mode I will find this:
created:
“{ date }”:
And after applying the template the creation date will not be set:
I would vote for a bug → I opened a bug report.
1 Like
Workaround
Open note in default app.
Write again {{date}}
Save
It should be good for this template and don’t change again.
More stable solution is community plugin Templater
(not Templates).
system
Closed
February 17, 2024, 2:46pm
7
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.