mirror of https://github.com/snachodog/mybuddy.git
Ensure naps card uses minimum date _without_ a time value
This commit is contained in:
parent
93207d88fe
commit
bcfa352b9b
|
@ -144,7 +144,7 @@ def card_sleep_naps_day(child, date=None):
|
||||||
:returns: a dictionary of nap data statistics.
|
:returns: a dictionary of nap data statistics.
|
||||||
"""
|
"""
|
||||||
date = timezone.localtime(date).astimezone(timezone.utc)
|
date = timezone.localtime(date).astimezone(timezone.utc)
|
||||||
instances = models.Sleep.naps.filter(child=child, start__date=date)
|
instances = models.Sleep.naps.filter(child=child, start__date=date.date())
|
||||||
return {
|
return {
|
||||||
'type': 'sleep',
|
'type': 'sleep',
|
||||||
'total': instances.aggregate(Sum('duration'))['duration__sum'],
|
'total': instances.aggregate(Sum('duration'))['duration__sum'],
|
||||||
|
|
Loading…
Reference in New Issue