Closed tim-hilt closed 1 year ago
Hey, I believe the root cause here is that Obsidian allows multiple definitions of the pathPrefix
for daily notes. To tackle this, we have to think about the path to a daily file, which consists of two components:
Edit: pathPrefix
is the Note Folder
setting and the second part of the path is the Format
setting
This gives us three options we need to cover:
pathPrefix/
+ 2022/Feb/01.md
pathPrefix
+ 2022/Feb/01.md
/pathPrefix/
+ 2022/Feb/01.md
In order to get the moment timestamp from the path, we have to remove the pathPrefix
from the complete path and cover all three cases, since they're all valid settings in Obsidian.
I reckon that's also why this sort of issue surfaces once we address it for one of the other cases. What do you think about this? Am I missing something?
Now that I think of those issues again, I think the discussion should actually be a different one: path-handling is becoming too confusing. We should refactor the settings-parsing, so that we can rely on the daily-notes-path being of the form path/to/
with a slash at the end.
this way we don’t have to parse the notes-path when the rollover-function runs. Paths will be handled the same way everytime then.
Sorry for taking so long. I ran some tests locally and it still works as expected :+1:
Going to implement the path handling you proposed, in v2, in the summer when there is more time available.
Fixes #94