Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sleep segment duration sometimes incorrect #2

Open
trevorshannon opened this issue Jan 19, 2022 · 1 comment
Open

Sleep segment duration sometimes incorrect #2

trevorshannon opened this issue Jan 19, 2022 · 1 comment

Comments

@trevorshannon
Copy link
Contributor

trevorshannon commented Jan 19, 2022

I noticed that yesterday's (1/18) long sleep duration was not correct, showing around 0:30 instead of 5:17. As I looked at it I also noticed that the duration was changing, getting smaller. It seemed to be comparing the sleep ended time to the time now (hours/minutes only, date excluded) rather than the associated sleep start.

I think this is the sleep time bug noticed already

@trevorshannon
Copy link
Contributor Author

I think the issue is here, because one of the sleep entries is being edited to calculate total sleep in the last 24hr. That edited entry is then used in the subsequent segment duration calculation.

items[i + 1].time = yesterday.getTime();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant