Fix timezones

This commit is contained in:
Nathan Chapman 2021-07-28 20:39:07 -06:00
parent ce7d479f19
commit 7bfa094ac7
2 changed files with 4 additions and 2 deletions

View File

@ -20,6 +20,8 @@
<span class="today__time">{{event.time|time:"TIME_FORMAT"}}</span> <span class="today__time">{{event.time|time:"TIME_FORMAT"}}</span>
<span><a href="{% url 'event-update' event.pk %}">Edit</a></span> <span><a href="{% url 'event-update' event.pk %}">Edit</a></span>
</div> </div>
{% empty %}
<p><em>Nothing for today.</em></p>
{% endfor %} {% endfor %}
</div> </div>
</section> </section>

View File

@ -21,9 +21,9 @@ class ProfileView(LoginRequiredMixin, TemplateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
today = date.today() today = timezone.localtime(timezone.now()).date()
tomorrow = today + timedelta(days=1) tomorrow = today + timedelta(days=1)
enddate = today + timedelta(days=6) enddate = today + timedelta(days=7)
context['profile'] = self.request.user.profile context['profile'] = self.request.user.profile
context['latest_activity'] = LogEntry.objects.all()[:10] context['latest_activity'] = LogEntry.objects.all()[:10]
context['today'] = Event.objects.filter( context['today'] = Event.objects.filter(