fix: use tz-aware meeting datetime to decide when to show ical link (#4429)
* refactor: reimplement Meeting.end_datetime() using datetime_from_date helper * fix: use tz-aware meeting datetime to decide when to show ical link
This commit is contained in:
parent
4084d7d557
commit
dcb6da947e
|
@ -138,11 +138,14 @@ class Meeting(models.Model):
|
|||
def end_date(self):
|
||||
return self.get_meeting_date(self.days-1)
|
||||
|
||||
def start_datetime(self):
|
||||
"""Start-of-day on meeting.date in meeting time zone"""
|
||||
return datetime_from_date(self.date, self.tz())
|
||||
|
||||
def end_datetime(self):
|
||||
"""Datetime of the first instant _after_ the meeting's last day"""
|
||||
return self.tz().localize(
|
||||
datetime.datetime.combine(self.get_meeting_date(self.days), datetime.time())
|
||||
)
|
||||
"""Datetime of the first instant _after_ the meeting's last day in meeting time zone"""
|
||||
return datetime_from_date(self.get_meeting_date(self.days), self.tz())
|
||||
|
||||
def get_00_cutoff(self):
|
||||
start_date = datetime.datetime(year=self.date.year, month=self.date.month, day=self.date.day, tzinfo=pytz.utc)
|
||||
importantdate = self.importantdate_set.filter(name_id='idcutoff').first()
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<br>
|
||||
<small class="text-muted">{{ acronym }}</small>
|
||||
</h1>
|
||||
{% if meeting.date >= thisweek %}
|
||||
{% if meeting.start_datetime >= thisweek %}
|
||||
<a class="regular float-end"
|
||||
title="icalendar entry for {{ acronym }}@{{ meeting.number }}"
|
||||
aria-label="icalendar entry for {{ acronym }}@{{ meeting.number }}"
|
||||
|
|
Loading…
Reference in a new issue