obsidian-periodic-notes icon indicating copy to clipboard operation
obsidian-periodic-notes copied to clipboard

[BUG] Incorrect date format in template's {{date}} variable when setting Format setting

Open Bloodsucker opened this issue 2 years ago • 2 comments

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

  1. Configure the plugin to use a template with the {{date}} variable
  2. In the plugin settings, set the "Format" setting to YYYY/MM/YYYY-MM-DD (or to any format you wish)
  3. Create a new daily note
  4. Observe that the note's path and filename are correct YYYY/MM/YYYY-MM-DD, however the template's {{date}} variable is also YYYY/MM/YYYY-MM-DD instead of YYYY-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

Bloodsucker avatar Jan 14 '23 18:01 Bloodsucker

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.

bo-boka avatar May 17 '23 02:05 bo-boka

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!

csegeb avatar Sep 12 '23 16:09 csegeb