nldates-obsidian icon indicating copy to clipboard operation
nldates-obsidian copied to clipboard

Use "Daily Notes" as default folder?

Open jrgong420 opened this issue 3 years ago • 8 comments

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?

jrgong420 avatar May 12 '21 09:05 jrgong420

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/

zephraph avatar May 17 '21 00:05 zephraph

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

argenos avatar May 17 '21 07:05 argenos

[Daily Notes/]YYYY-MM-DD

Thx, that worked! In case anyone else has same issue, this goes into settings > nldates > Date format

jrgong420 avatar May 17 '21 10:05 jrgong420

We can probably close this (unless there needs to be some extra documentation somewhere).

zephraph avatar May 27 '21 04:05 zephraph

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

image

nateritter avatar Oct 04 '21 12:10 nateritter

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.

pm64 avatar Sep 01 '22 04:09 pm64

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

dutry avatar Oct 07 '22 02:10 dutry

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:

  1. NLDates Plugin - Configure Date Format to be [[[]YYYY-MM-DD[]]]
  2. This will cause dates to be inserted as [[2023-11-05]]
  3. Use Community Plugin: Obsidian Link Converter
  4. Configure it to Convert Link Format to Relative
  5. Assign a HotKey to Obsidian Link Converter: Active File: Links to Markdown. I chose Ctrl + Shft + M

Now when adding dates, your workflow becomes:

  1. Type @Today => let the date auto populate
  2. Use hotkey Ctrl + Shft + M to convert to relative path markdown link

philosowaffle avatar Nov 05 '23 13:11 philosowaffle