mirror of https://github.com/snachodog/mybuddy.git
Corrections to last_end_time made to correctly calculate and display graphs on days where the sleep from the previous day did not cross over midnight. resolves babybuddy/babybuddy#554
This commit is contained in:
parent
2e7dedea45
commit
6816349103
|
@ -64,6 +64,10 @@ def sleep_pattern(sleeps):
|
||||||
)
|
)
|
||||||
duration = end_time - start_time
|
duration = end_time - start_time
|
||||||
|
|
||||||
|
if last_end_time:
|
||||||
|
if last_end_time.date() < start_time.date():
|
||||||
|
last_end_time = start_time.replace(hour=0, minute=0, second=0)
|
||||||
|
|
||||||
if not last_end_time:
|
if not last_end_time:
|
||||||
last_end_time = start_time.replace(hour=0, minute=0, second=0)
|
last_end_time = start_time.replace(hour=0, minute=0, second=0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue