Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create new file #66

Open
Craftidore opened this issue Sep 15, 2021 · 13 comments
Open

Unable to create new file #66

Craftidore opened this issue Sep 15, 2021 · 13 comments

Comments

@Craftidore
Copy link

Craftidore commented Sep 15, 2021

My weekly note settings:
image

When I select the command "Open Weekly Note" this message appears
image

This message only appears after a weekly note has been created. However, the weekly note created when I originally select the command "Open Weekly Note" has the week # listed as 36, while the Weekly note settings claim it should be 37
image
If I delete the current weekly note, then run the command, a new note is created (but with the wrong week # as previously mentioned).
Furthermore, when I select the command "Open Next Weekly Note," provided a weekly note has already been created, will open the first weekly note I created (even if I'm not currently viewing a weekly note).

Daily Note and Monthly Note function as expected.
Daily Note Settings (through Periodic Notes, not through the core daily note pluggin):
image
Monthly Note Settings:
image

And, in the off chance that it is relevant, Calendar Note settings
image

Obsidian Version: v0.12.15
OS: Windows 10, current version as of September 15th, 2021
Hardware: 5 year old Microsoft Surfacebook

@Craftidore
Copy link
Author

Problems ceased after latest update (Version 0.2.5)

@Craftidore
Copy link
Author

Correction:
"Open Weekly Note" and "Open Next Weekly Note" now work as expected, but the note numbering is still inconsistent with what is shown in settings and I cannot create new weekly notes from the Calendar Pluggin.

@Craftidore Craftidore reopened this Sep 18, 2021
@zachdaniel
Copy link

I'm experiencing this issue, "Unable to create new file" when I try to open the weekly note.

@daniloascione
Copy link

Same issue here.

I changed the name template and a new file was created but with the wrong file name: I changed "YYYY-MM_[CW]WW" to "YYYY-MM_[CW]WW_2" but "2022-01_CW03_2" was created instead of the correct "2022-01_CW04_2". The name preview in the plugin option window is correct.

If I click the "Open this week" button again, then it fails with same error (because it tries to create a file that already exists?)

@clolesen
Copy link

I had this exact same issue. When I used the WW format in periodic notes it used the week number minus 1 when creating the file name, and thus where unable to create the file when that file name already existed. It also used the week number minus 1 when formating note templates with {{date: WW}}. Like it knew it was week 7, when pushing the "open this week" button, which prompted the creation of a new file, but then used the week number 6 for file creation.

However, when I then installed the calendar plugin, everything worked fine, even with the calendar plugin turned off. As if it had overwritten some files that fixed the bug.

@jkrcma
Copy link

jkrcma commented Mar 14, 2022

Thank you @clolesen! I've been having the exact same issue as described above, and by installing the Calendar plugin the problem magically disappeared and WW now refers to the correct (current) week number, in this exact case to week 11. Before the calendar plugin it pointed to week 10.

@jeremymturner
Copy link

I ran into this same problem. The docs point to moment.js for the formatting style (https://momentjs.com/docs/#/displaying/format/) and I noticed that my particular naming style was mixing ISO and non-ISO variables, e.g. 'gggg' and 'WW'. When I changed 'WW' to 'ww', I no longer have this issue.

I suspect that you either need to stick with all ISO or all non-ISO in the variable usage or else something gets confused.

@minchinweb
Copy link

minchinweb commented Jul 10, 2022

I get this same message when I try to create a file that already exists. I'm running into this because the week number doesn't match the file it tries to create.

@cameronj86
Copy link

cameronj86 commented Mar 10, 2023

@jeremymturner's resolution worked for me. One quirky thing was that it was thrown off by the passed-through/escaped text and not the ISO-related text:

  • gggg[ - Week ]w - Creates an error because the escaped text starts w/ a capital letter
  • GGGG[ - Week ]W - Works as expected

@hovren
Copy link

hovren commented Apr 3, 2023

I had issues with the week set wrong as well ("GGGG-W" converted to "2023-13" instead of the correct "2023-14". I installed the Calendar plugin, and at first it did not help, but then I checked the Calendar plugin config and changed "start of week" from Sunday to Monday and then it worked and created the note at "2023-14" as expected. For clarity: today is Monday.

@grooviekenn
Copy link

grooviekenn commented Nov 26, 2023

I'm coming across the same issue. Can anyone suggest how I can get the following to play nice: YYYY - [Q]QQ - [M]MM - [W]WW?

I've also tried gggg - [Q]QQ - [M]MM - [W]ww.

@TraceyC77
Copy link

I am experiencing the same error when trying to create a weekly note by clicking the week number in the calendar. The wrong week is selected. Today is Monday. It seems that using all ISO date formatting triggers the bug.

Steps to reproduce:

  • Clicked on week 24 in the Calendar pane on the right. I was prompted to create the weekly note.
  • This created the weekly note for week 23. Edited and saved. (Incorrectly named under 2024/2024-W23)
  • Clicked on week 24 and was prompted to create the weekly note. The pop up has the wrong file name. (File 2024/2024-W23 does not exist. Would you like to create it?)
  • Clicked Create
  • Observed error "Unable to create new file".

If I click week 25 I am prompted to create the weekly note 2024/2024-W24.
The plugin is attempting to creating the note with a filename for the week prior to the one selected.

I tried changing from mixed format (YYYY/gggg-[W]WW) to ISO only (YYYY/GGGG-[W]WW) but that still triggers the bug.
I tried changing to non-ISO (yyyy/gggg-[W]ww) and that made the proposed file name match the week number.

So there are two issues:

  • The plugin detects correctly that the file for the week selected does not exist when that is the case BUT the pop up shows the week prior to the one selected for the file name
  • The plugin then attempts to create the file with the mismatched filename but cannot if the file already exists

@AnsgarLichter
Copy link

@jeremymturner's resolution worked for me as well - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests