From e3b73d53c52a838ce8aa3aacd7057fdb416bb156 Mon Sep 17 00:00:00 2001 From: Christopher Charbonneau Wells Date: Tue, 22 Aug 2017 21:36:44 -0400 Subject: [PATCH] Replace timezone.now() usage with localtime. --- dashboard/templatetags/dashboard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard/templatetags/dashboard.py b/dashboard/templatetags/dashboard.py index a15e98d2..d2628fc6 100644 --- a/dashboard/templatetags/dashboard.py +++ b/dashboard/templatetags/dashboard.py @@ -30,7 +30,7 @@ def card_diaperchange_types(child): """Diaper change statistics for the last seven days including today.""" stats = OrderedDict() for x in range(0, 7): - date = (timezone.now() - timezone.timedelta(days=x)).date() + date = (timezone.localtime() - timezone.timedelta(days=x)).date() stats[date] = {'wet': 0, 'solid': 0} instances = DiaperChange.objects.filter( @@ -58,7 +58,7 @@ def card_tummytime_last(child): @register.inclusion_tag('cards/tummytime_day.html') -def card_tummytime_day(child, date=timezone.now().date()): +def card_tummytime_day(child, date=timezone.localtime().date()): instances = TummyTime.objects.filter( child=child, end__day=date.day).order_by('-end') stats = {