zincplusplus/habit-tracker

Issue with date. It does't recognise today date correctly or it works on other time zone

zuwf opened this issue ยท 15 comments

zuwf commented

Screenshot from 2023-12-27 00-39-17
Screenshot from 2023-12-27 00-38-31

Today's date is 27-12-23 I filled those checks on 25th and 26th but it showing on 27th. on rechecking by removing and checking again , the checks are inserted with yesterday's date on the habit file. but dots are shown in today's date in query file

This is a weird one. Will need to investigate...

zuwf commented

This is a weird one. Will need to investigate...

I tested with other device and changed the timezones.. and found that it follows GMT and ours was GMT + 5.30

Thanks. This narrows it down for me. Will work on a fix asap

This should be fixed with https://github.com/zoreet/habit-tracker/releases/tag/1.1.2

Could you pls give it a test and confirm it's working now?

zuwf commented

No , It become even more buggy. The current date is fixed with 30-12-2023, and checking date fixed with 29th constantly. It not changed by at any point , I tried by changing my mobile's date and time a week forward, still the checking date is same and result in the query page stuck with 30th, in general it not actually detects the device time and date

This is SO weird. I'll try to test this with a colleague that leaves in your timezone. If they're not available, would you mind jumping on a call with me? I'd like to share some debug code with you to understand what's happening. The reason why I'm puzzled is because before I was definitely following GMT ( by mistake ), but with the current it should work OK.

Hi there! Happy New Year!

I have the same bug in Linux but on Android everything is OK. GMT+4.

Hi, Same issue here, on MacOS,

I managed to reproduce the bug and pushed version 1.1.4 with a fix. Can you please test it and let me know if it works?

It works! Thanks a lot!

Works here as well, thank you very much for the fast fix.

zuwf commented

Still having the GMT issue, I tested by setting upcoming dates in my device with 12.01 AM , the checks I made during that time creating entries in previous day. But changing the time by 5.30 AM I am able to check with the actual date I set on my device

Found one last piece of the puzzle. I was using toISOString to convert a Date object to YYYY-MM-DD and this uses the UTC timezone always.

Released 1.1.5 which fixes this. Thank you @zuwf for details on how to reproduce, and the patience to keep on testing.

Re-released 1.1.5 because it still had some debug code in it

zuwf commented

Re-released 1.1.5 because it still had some debug code in it

Thank you ๐Ÿ˜ฌ๐Ÿ˜‡ , Working fine for me now..
I didn't got the re-release yet.. I commented the line.. and everything is works perfectly