From 7bfa094ac73357cff235e208f98a3e10578f736d Mon Sep 17 00:00:00 2001 From: Nathan Chapman Date: Wed, 28 Jul 2021 20:39:07 -0600 Subject: [PATCH] Fix timezones --- accounts/templates/accounts/profile.html | 2 ++ accounts/views.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/accounts/templates/accounts/profile.html b/accounts/templates/accounts/profile.html index 9a54ced..945c2df 100644 --- a/accounts/templates/accounts/profile.html +++ b/accounts/templates/accounts/profile.html @@ -20,6 +20,8 @@ {{event.time|time:"TIME_FORMAT"}} Edit + {% empty %} +

Nothing for today.

{% endfor %} diff --git a/accounts/views.py b/accounts/views.py index 1d0ffad..3489992 100755 --- a/accounts/views.py +++ b/accounts/views.py @@ -21,9 +21,9 @@ class ProfileView(LoginRequiredMixin, TemplateView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - today = date.today() + today = timezone.localtime(timezone.now()).date() tomorrow = today + timedelta(days=1) - enddate = today + timedelta(days=6) + enddate = today + timedelta(days=7) context['profile'] = self.request.user.profile context['latest_activity'] = LogEntry.objects.all()[:10] context['today'] = Event.objects.filter(