Skip to content

Commit

Permalink
Merge pull request #26 from molgen/fix-event-timezones
Browse files Browse the repository at this point in the history
events: Fill ics calendar with TZ-aware datetimes
  • Loading branch information
donald authored Nov 11, 2019
2 parents a70b757 + f8f5353 commit fc46f27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mpicms/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ class Event(BodyMixin, BasePage):
@property
def start(self):
if self.start_time:
return datetime.combine(self.start_date, self.start_time)
return datetime.combine(self.start_date, self.start_time).astimezone()
return self.start_date

@property
def end(self):
if self.end_time:
date = self.end_date or self.start_date
return datetime.combine(date, self.end_time)
return datetime.combine(date, self.end_time).astimezone()
return self.end_date

def get_dict(self, request=None):
Expand Down

0 comments on commit fc46f27

Please sign in to comment.