zincplusplus / habit-tracker

GNU General Public License v3.0
47 stars 7 forks source link

Bug: Wrong data being displayed #30

Open bjornfiles opened 5 months ago

bjornfiles commented 5 months ago

First of all, thank you for creating this very elegant plugin (when it works).

It's the lightest, lowest-friction and, IMO most outcome-focused take on habit tracking I've seen to date, in or outside of Obsidian.

However, as of today it's completely failing for me:

This is my Habit Tracker code block in my daily note template:

{
    "path": "system/Habit Tracker 21",
    "lastDisplayedDate": "2024-04-15"
}

But I'm not seeing my recent completed habit boxes and the "current month" displayed ends at 30, when March has 31 days.

Screenshot here:

image

zincplusplus commented 5 months ago

Thank you @bjornfiles ❤️

This is super duper weird. I suspect it's a date issue, especially since it skipped the last day of March. Probably that's not March at all.

By any chance could you share a copy of your vault? If not, can you help with this info:

TheRealPJC commented 3 months ago

I get the same issue, and as you suggest @zoreet, setting the "lastDisplayedDate" caused the wrong month (out by one) to be displayed. For example, when I set "lastDisplayedDate" to be "2024-04-26" (i.e. up to 26 April), the grid show habits completed up to 26 May. An issue with the lovely js Date library?

zincplusplus commented 3 months ago

Shit. Let me looks into it

zincplusplus commented 3 months ago

I can't figure it out, so I will need your help. I've released a new version that has 2 features to help me debug this issue.

  1. If you hover over the date in the header it will show you a tooltip with the actual date being rendered. That way we can know for sure if the correct date is rendered.

  2. If you add "debug": 1 to your config it should show some additional data below the table. Right now it's very basic, but for this problem I'm only interested in lastDisplayedDate

Can you pls give this a try and report back? @TheRealPJC @bjornfiles

TheRealPJC commented 3 months ago

OK, I tried the debug version, and I cannot reproduce the problem. The mouse-over dates, debug JSON and displayed habits data all behave exactly as expected. I'm not sure what is going on...

pinetreemoonlight commented 2 months ago

The date displayed is also wrong for me, right now it starts at 29 May 2024 and I cannot change it even when I include lastDisplayDate

pinetreemoonlight commented 2 months ago

I can't figure it out, so I will need your help. I've released a new version that has 2 features to help me debug this issue.

  1. If you hover over the date in the header it will show you a tooltip with the actual date being rendered. That way we can know for sure if the correct date is rendered.
  2. If you add "debug": 1 to your config it should show some additional data below the table. Right now it's very basic, but for this problem I'm only interested in lastDisplayedDate

Can you pls give this a try and report back? @TheRealPJC @bjornfiles

image

My timezone is gmt+2

zincplusplus commented 2 months ago

@pinetreemoonlight I'm confused. Is the value for lastDisplayedDate correct? Because if it is, it looks like the habit tracker 21 is rendering the days between 2024-05-29 and 2024-06-18 which is exactly 21 days.