liamcain / obsidian-daily-notes-interface

Package to create, open, and find daily notes from your Obsidian plugin
MIT License
84 stars 10 forks source link

[Bug] Date parsing is broken for unusual date formats, all notes appear in the current month #28

Closed bit2pixel closed 10 months ago

bit2pixel commented 11 months ago

The current broken version is unable to parse unusual custom formats such as YYYY/MM MMM/DD ddd.

The Moment date object created from Daily Notes 🧠/2023-09-08_Fri.md returns Fri Dec 08 2023 00:00:00 GMT-0800. Note that it returns December instead of September.

The reason for this is that the current version is trying to create a Moment date object with DD ddd when "day" is passed into the getDateFromFile function. As a result, the Moment library has the month as null and it automatically falls back to the current month, which is December now.

This causes all my previous notes to appear in the current month.

bit2pixel commented 10 months ago

Turns out that daily/periodic notes require a unique file names to work properly and DD ddd generates duplicates. After I fixed that, the issue is now resolved. Closing this issue.