Richardsl / heatmap-calendar-obsidian

An Obsidian plugin for displaying data in a calendar similar to the github activity calendar
Apache License 2.0
645 stars 103 forks source link

Jan. 1 2023 not showing up? #60

Open chiumax opened 1 year ago

chiumax commented 1 year ago

Might be missing something obvious here, but my note dated for Jan 1 2023 shows up in 2022 and not in 2023:

note in question:

image

2022 calendar:

image

2023 calendar:

image
maskedmage77 commented 1 year ago

I'm pretty sure this is the same issue as Issue #57 I have a code that should fix the issue but it just needs looked at by the plugin developer.

maskedmage77 commented 1 year ago

If you want a fix until the plugin is updated, you can open the main.js of the plugin and change line 89 from this:

const calEntriesNotInDisplayedYear = (_a = entries.filter((e) => new Date(e.date).getFullYear() !== year)) != null ? _a : this.settings.entries;

to this:

const calEntriesNotInDisplayedYear = (_a = entries.filter((e) => new Date(e.date + "T00:00").getFullYear() !== year)) != null ? _a : this.settings.entries;

The + "T00:00" forces it to create the date correctly and fixes the issue.

chiumax commented 1 year ago

@maskedmage77 thanks :thumbs-up:

halfst commented 1 year ago

I'm also having this issue, hence why I'm here.