diff --git a/dashboard/templatetags/cards.py b/dashboard/templatetags/cards.py index 52af5c2c..4cdf6b6b 100644 --- a/dashboard/templatetags/cards.py +++ b/dashboard/templatetags/cards.py @@ -240,15 +240,17 @@ def _feeding_statistics(child): """ feedings = [ { - 'start': timezone.now()-timezone.timedelta(days=3), - 'title': _('Feeding frequency')+ " 3 "+_("days") - }, - { - 'start': timezone.now()-timezone.timedelta(weeks=2), - 'title': _('Feeding frequency') + " 2 "+_("weeks") + 'start': timezone.now()-timezone.timedelta(days=3), + 'title': _('Feeding frequency (past 3 days)') }, { - 'start': timezone.make_aware(datetime.combine(date.min, time(0,0)) + timezone.timedelta(days=1) ), + 'start': timezone.now()-timezone.timedelta(weeks=2), + 'title': _('Feeding frequency (past 2 weeks)') + }, + { + 'start': timezone.make_aware( + datetime.combine(date.min, time(0, 0)) + + timezone.timedelta(days=1)), 'title': _('Feeding frequency') } ] @@ -264,7 +266,8 @@ def _feeding_statistics(child): if last_instance: for timespan in feedings: if last_instance.start > timespan['start']: - timespan['btwn_total'] += instance.start - last_instance.end + timespan['btwn_total'] += (instance.start + - last_instance.end) timespan['btwn_count'] += 1 last_instance = instance