nldates-obsidian
nldates-obsidian copied to clipboard
Use "Daily Notes" as default folder?
when referencing a specific day, how can I enable the plugin to use the default folder that is set up in the "Daily Notes" core plugin?
Given that this plugin uses moment.js under the hood, you can achieve this yourself.
Here's what I have setup:
[Daily Notes/]YYYY-MM-DD
Essentially everything inside [ ]
is escaped.
Docs here: https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/
The links created are regular links. The corresponding FR in the Obsidian forums: https://forum.obsidian.md/t/creating-or-recognizing-daily-notes-inline-in-the-editor/4730
[Daily Notes/]YYYY-MM-DD
Thx, that worked! In case anyone else has same issue, this goes into settings > nldates > Date format
We can probably close this (unless there needs to be some extra documentation somewhere).
Given that this plugin uses moment.js under the hood, you can achieve this yourself.
Here's what I have setup:
[Daily Notes/]YYYY-MM-DD
Essentially everything inside
[ ]
is escaped.Docs here: https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/
For anyone else trying to figure out where to make this modification, it's in the Settings > Natural Language Dates > Date format
While this approach does work for some use cases, many users won't necessarily want to see the path to their daily notes folder in the link text. There would be value in adding a "Use 'Daily Notes' as default folder" option that places the note in the user's daily notes folder (per Obsidian configuration), with link text containing only the date.
Example of generated link: [[Daily/2022-09-21|2022-09-21]]
However, in my opinion the best way to implement this would be to simply allow separate formats for the link and link text.
It is totally not elegant, because the shown text is also with redundant text "Daily Notes/", which is ugly.
Is it possible to automatically detect the folder? At least provide an option as the plug-in Calendar did for Weekly Notes
Another reason this solution isn't ideal is for those of us who use relative path Markdown links. I choose to use relative path links so that my note links continue to work outside of obsidion (like in a GitHub repo). Using strict formatting to achieve the file linking behavior means none of my date links can have the correct relative path to my Daily Notes.
My current workaround involves the following setup:
- NLDates Plugin - Configure Date Format to be
[[[]YYYY-MM-DD[]]]
- This will cause dates to be inserted as
[[2023-11-05]]
- Use Community Plugin:
Obsidian Link Converter
- Configure it to Convert Link Format to
Relative
- Assign a HotKey to
Obsidian Link Converter: Active File: Links to Markdown
. I choseCtrl + Shft + M
Now when adding dates, your workflow becomes:
- Type
@Today
=> let the date auto populate - Use hotkey
Ctrl + Shft + M
to convert to relative path markdown link