Skip to content

Commit

Permalink
Merge branch 'main' into fix-active-events
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobCoffee authored Sep 13, 2024
2 parents abf0dc1 + 30f3cb4 commit 52965bb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion events/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ def import_occurrence(self, event, event_data):
# but won't add any timezone information. We will convert them to
# aware datetime objects manually.
dt_start = extract_date_or_datetime(event_data['DTSTART'].dt)
dt_end = extract_date_or_datetime(event_data['DTEND'].dt)
if 'DTEND' in event_data:
# DTEND is not always set on events, in particular it seems that
# events which have the same start and end time, don't provide
# DTEND. See #2021.
dt_end = extract_date_or_datetime(event_data['DTEND'].dt)
else:
dt_end = dt_start

# Let's mark those occurrences as 'all-day'.
all_day = (
Expand Down
6 changes: 3 additions & 3 deletions events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class OccurringRule(RuleMixin, models.Model):

def __str__(self):
strftime = settings.SHORT_DATETIME_FORMAT
return f'{self.event.title} {date(self.dt_start.strftime, strftime)} - {date(self.dt_end.strftime, strftime)}'
return f'{self.event.title} {date(self.dt_start, strftime)} - {date(self.dt_end, strftime)}'

@property
def begin(self):
Expand Down Expand Up @@ -290,8 +290,8 @@ class RecurringRule(RuleMixin, models.Model):
all_day = models.BooleanField(default=False)

def __str__(self):
strftime = settings.SHORT_DATETIME_FORMAT
return f'{self.event.title} every {timedelta_nice_repr(self.interval)} since {date(self.dt_start.strftime, strftime)}'
return (f'{self.event.title} every {timedelta_nice_repr(self.freq_interval_as_timedelta)} since '
f'{date(self.dt_start, settings.SHORT_DATETIME_FORMAT)}')

def to_rrule(self):
return rrule(
Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<link rel="apple-touch-icon" href="{{ STATIC_URL }}apple-touch-icon-precomposed.png">

{# Tile icon for Win8 (144x144 + tile color) #}
<meta name="msapplication-TileImage" content="{{ STATIC_URL }}metro-icon-144x144-precomposed.png"><!-- white shape -->
<meta name="msapplication-TileImage" content="{{ STATIC_URL }}metro-icon-144x144.png"><!-- white shape -->
<meta name="msapplication-TileColor" content="#3673a5"><!-- python blue -->
<meta name="msapplication-navbutton-color" content="#3673a5">

Expand Down

0 comments on commit 52965bb

Please sign in to comment.