coddingtonbear / obsidian-local-rest-api

Unlock your automation needs by interacting with your notes in Obsidian over a secure REST API.
MIT License
644 stars 59 forks source link

Notes writen in the wrong file when core obsidian "daily notes" are setup with path in date format #45

Closed pae23 closed 1 year ago

pae23 commented 1 year ago

I use Obsidian 1.0.3 and Local rest api plugin.

I want my dailynotes in a subfolder per month : content/diary/YYYY/MM/DD.md

So today in content/diary/2022/12/04/md

But when I add a note from chrome using the extension configured with local API, my note is writen in content/diary/2017/12/04.dm (.dm is not a typo)

The obsidian core daily notes is configure this way : date format : YYYY/MM/DD new file location : content/diary

This is working fin in obsidian, I've the "Open daily note on startup check" and the right file is created at this moment.

coddingtonbear commented 1 year ago

I'm afraid that if that is a bug, it isn't a bug in this plugin -- we directly access the interface provided by the periodic notes plugin for creating those notes: see: https://github.com/coddingtonbear/obsidian-local-rest-api/blob/64f04f4f4efed9f872e5816304381decc60c1c0d/src/requestHandler.ts#L446. That interaction involves us simply passing it a date object, and that plugin does whatever it needs to do to calculate the correct filename before giving us a new file to write to. To be clear: what I mean by this is that the "local rest api" plugin is not involved in setting what your files are named.

What I'd recommend is:

  1. Checking your settings in obsidian's settings' "Periodic Notes" section to make sure there's not some kind of error there.
  2. Updating your "Periodic Notes" plugin; maybe there's a bug in your particular version?
  3. If that still doesn't answer any questions: open a bug report under that repo here: https://github.com/liamcain/obsidian-periodic-notes.

Good luck!