I do all my planning at the weekly level, and so my daily note is a weekly note.
If one uses the core plugin daily note with a format string of "YYYY-WW" or "gggg-ww", then selecting "Daily note" as the choice for logging will yield a "Cannot create new file" error, because getDailyNote():
looks for daily notes
doesn't find the weekly notes because they're not daily
tries to create a file using the configured daily file name template string
the daily file name template string yields a weekly note filename
gets an error that the weekly file already exists
The solution here is to lean on obsidian-daily-notes-interface a bit more to detect daily vs weekly notes, and then call the corresponding get/create functions. It's a bit unfortunate that there's no getPeriodicNote() in the way that there's a createPeriodicNote() to help remove code duplication.
There's a little bonus here that if a user disables their daily note plugin(s), then the option will stop showing up in the listing, which is a minor existing bug.
Also, this is the first time I've ever written typescript, so literally no idea what proper typescript is. :shrug:
I do all my planning at the weekly level, and so my daily note is a weekly note.
If one uses the core plugin daily note with a format string of "YYYY-WW" or "gggg-ww", then selecting "Daily note" as the choice for logging will yield a "Cannot create new file" error, because getDailyNote():
The solution here is to lean on obsidian-daily-notes-interface a bit more to detect daily vs weekly notes, and then call the corresponding get/create functions. It's a bit unfortunate that there's no getPeriodicNote() in the way that there's a createPeriodicNote() to help remove code duplication.
There's a little bonus here that if a user disables their daily note plugin(s), then the option will stop showing up in the listing, which is a minor existing bug.
Also, this is the first time I've ever written typescript, so literally no idea what proper typescript is. :shrug: