habit-tracker icon indicating copy to clipboard operation
habit-tracker copied to clipboard

Bug: Wrong data being displayed

Open bjornfiles opened this issue 1 year ago • 10 comments

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

bjornfiles avatar Mar 31 '24 16:03 bjornfiles

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:

  • what is your timezone?
  • can you get it to work in any other files, path or config?
  • since data is missing, I assume it was working before: can you tell me what happened around the time it broke?

zincplusplus avatar Apr 06 '24 13:04 zincplusplus

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?

TheRealPJC avatar May 31 '24 22:05 TheRealPJC

Shit. Let me looks into it

zincplusplus avatar Jun 02 '24 11:06 zincplusplus

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

zincplusplus avatar Jun 06 '24 11:06 zincplusplus

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...

TheRealPJC avatar Jun 06 '24 21:06 TheRealPJC

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 avatar Jun 18 '24 03:06 pinetreemoonlight

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

pinetreemoonlight avatar Jun 18 '24 03:06 pinetreemoonlight

@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.

zincplusplus avatar Jun 25 '24 18:06 zincplusplus

It's October and I see March dates. I just installed the plugin, only the default "path": "Habits/ parameter added. What's going on?

ronilaukkarinen avatar Oct 04 '24 09:10 ronilaukkarinen

...oh I added the path parameter the md file inside the Habits folder, that's why... it shows a loooong horizontally scrollable list and the March is at the beginning, that's why. When I use it without parameters, it works.

ronilaukkarinen avatar Oct 04 '24 09:10 ronilaukkarinen