Data mismatch - Issue #520

Updates cards.py to use feeding end time to calculate total food for a given day. Ensures consitency between the dashboard and reporting.
This commit is contained in:
matthieu-kr 2022-09-06 23:19:17 -04:00 committed by Christopher Charbonneau Wells
parent 872abcdd0d
commit 2690ab4876
1 changed files with 1 additions and 1 deletions

View File

@ -135,7 +135,7 @@ def card_feeding_day(context, child, end_date=None):
# do one pass over the data and add it to the appropriate day
for instance in instances:
# convert to local tz and push feed_date to end so we're comparing apples to apples for the date
feed_date = timezone.localtime(instance.start).replace(
feed_date = timezone.localtime(instance.end).replace(
hour=23, minute=59, second=59, microsecond=9999
)
idx = (end_date - feed_date).days