obsidian-periodic-notes
obsidian-periodic-notes copied to clipboard
[BUG] Incorrect date format in template's {{date}} variable when setting Format setting
Issue description
The "Format" setting in the Periodic Notes Obsidian plugin is causing the {{date}}
variable in the configured template to use the user-specified format instead of the system default YYYY-MM-DD
.
Expected outcome
The {{date}}
variable in the configured template should use the system default format of YYYY-MM-DD
regardless of the "Format" setting in the plugin.
Steps to reproduce
- Configure the plugin to use a template with the
{{date}}
variable - In the plugin settings, set the "Format" setting to
YYYY/MM/YYYY-MM-DD
(or to any format you wish) - Create a new daily note
- Observe that the note's path and filename are correct
YYYY/MM/YYYY-MM-DD
, however the template's{{date}}
variable is alsoYYYY/MM/YYYY-MM-DD
instead ofYYYY-MM-DD
which I believe is wrong.
Workaround
Don't use the core's template plugin {{date}}
and instead use Templater plugin.
System Information Version: 0.0.17
Thanks for flagging. I would greatly appreciate if this was fixed since I don't currently use the Templater plugin & am trying to keep plugins light, but I appreciate the workaround. Having the date in the note is a standard desire for a journal.
Edit: OMG I just found a solution/workaround. Have been looking and trying for hours! I can confirm that {{date}} outputs everything that has been put into the Syntax field in the settings. My old remark (see below) is still valid in that regard. Basically its working as intended.
Workaround: Just use {{date:YYYY-MM-DD}} So simple and yet so stuid m(
Old: ~~Yes this is even worse when using dataview inside the note with {{date}} as a variable. Breaks the whole thing. The templater workaround is problematic because it can lead to conflicting dates (when creating a daily note for logging yesterday's activities after the fact, tp.now obviously has to be yesterday's date instead of today's). Very confusing.~~
In my mind, the whole folder-in-format-shenannigan is the root of the problem. After all, there IS an option to choose a folder. All it needs is the ability to input variables. The Syntax for the date should be reserved for the date!