obsidian-periodic-notes
obsidian-periodic-notes copied to clipboard
moment.js template values overridden by Periodic Notes
Background
I'm using YAML Front Matter / Obsidian Property created:
to set a static value when the file was created like this:
test: {{date:YYYYMMDDHHmm}}
Based on moment.js format, I expect this value to translate to YYYYMMDDHHmm, e.g. 202408200954
if the file was created on 2024-08-20 (year-month-date) at 09:54 (local time).
Finding
When using Periodic Notes and e.g. the moment.js template mentioned above (also seen in the screenshot below), I'm getting different values (e.g. different days), based on what note type I create; where I expect the template value to be identical (based on the template and moment the note is created). Does Periodic Note override the moment.js template values, somehow - for inline data?
To reproduce
- Create a template to be used for all note types, using the moment.js value of
{{date:YYYYMMDDHHmm}}
as variable. - Set the template to be used for all note types.
- Create new notes for daily, weekly, monthly, quarterly and yearly (all based on the very same template)
- Notice different moment values, even though it's created within the same "moment" using the same template.
Example
All notes created at 2024-08-20 on 09:54 (local time)
- Value for weekly is converted to last sunday (2024-08-18)
- Value for monthly get converted to first day of the month (2024-08-01)
- etc.
template and resulting notes, all created within the same minute.
(default settings, just enabled all note types, and used same template)
Other
- Timestamp seems to be correct, the "overrides" seems to be limited to dates (maybe more, I haven't tested every combination from moment.js docs).
Debug info
SYSTEM INFO: Obsidian version: v1.7.0 Installer version: v1.6.5 Operating system: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 23.5.0 Login status: logged in Catalyst license: supporter Insider build toggle: on Live preview: on Base theme: adapt to system Community theme: none Snippets enabled: 0 Restricted mode: off Plugins installed: 1 Plugins enabled: 1 1: Periodic Notes v0.0.17