Sobriety
Sobriety copied to clipboard
Bad time passed calculation when <24 hours
Installed fresh version from F-DROID today. It seems that when I set a new addiction and mark a start time yesterday afternoon, it adds a day to the calculation.
It was 09:00 (9am) today (6th) and I set an addiction start to 23:20 (11:23pm) last night (5th). It showed me 1 day and 9 hours, as it would elapse another day since that.
Hmmm. There have been some bugs with the date picker in the past so this may just be a reoccurrence of that, which I know how to fix. I'll look into it!
Sorry about that, I fixed this issue in the first commit of #96, but I can also separate it out into a different PR.
Oh that's ok! I'll look over #96 when I get a chance to!
I've noticed the same issue, though for me it persists for addiction created at any time. (limited testing, tried ~20 hours, ~2 days, ~1 week) they all seems to add exactly 1 day. I've also pretty much confirmed that it's not an issue with the date picker, as I exported data, and the epoch timestamps are all exactly as they should be. I poked around in your codebase briefly, but I'm not particularly familiar with Kotlin.
I would assume it's mostly with displaying, or perhaps an odd rounding error, but I have little proof of this
@KiARC It seems the bug was fixed, so when the new release is planned? It's been more than a year since 10.0.0.
I'm really sorry for not putting up 10.1.0 yet. The machine that had the signing keys died a while back and I still have not been able to recover them. The past several months have been swamped with schoolwork, but I finally might have a chance to figure this out. Again, I'm sorry for this getting delayed so much.
The problem seems to be that it starts counting at midnight, rather than when hours is greater than 24. Same for when hours would tick up past 24, the day doesn't actually increment until midnight. I'm guessing it was using a built in function, and it counted days by date rather than by hour.
As far as I'm aware, yes, that's what's happening