argenos / nldates-obsidian

Work with dates in natural language in Obsidian
MIT License
497 stars 46 forks source link

Use "Daily Notes" as default folder? #37

Open jrgong420 opened 3 years ago

jrgong420 commented 3 years ago

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?

zephraph commented 3 years ago

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/

argenos commented 3 years ago

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

jrgong420 commented 3 years ago
[Daily Notes/]YYYY-MM-DD

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

zephraph commented 3 years ago

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

nateritter commented 3 years ago

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

pm64 commented 2 years ago

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.

dutry commented 2 years ago

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

philosowaffle commented 11 months ago

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