Extended definition to years

This commit is contained in:
Maximilian Giller 2019-04-05 18:57:16 +02:00
parent 3e11ec4df0
commit 9e67af6adc

View file

@ -24,18 +24,21 @@ def event_prefix_str (event, relative_date=None):
#Is multiday event
if event.begin_datetime.day is not event.end_datetime.day or \
event.begin_datetime.month is not event.end_datetime.month:
event.begin_datetime.month is not event.end_datetime.month or \
event.begin_datetime.year is not event.end_datetime.year:
return event_time_summary(event)
#Relative to
#First day
if event.begin_datetime.day is relative_date.day and \
event.begin_datetime.month is relative_date.month:
event.begin_datetime.month is relative_date.month and \
event.begin_datetime.year is relative_date.year:
return event_time_summary(event) + first_occurrence_char
#Last day
elif event.end_datetime.day is relative_date.day and \
event.end_datetime.month is relative_date.month:
event.end_datetime.month is relative_date.month and \
event.end_datetime.year is relative_date.year:
event.begin_datetime = event.end_datetime
return event_time_summary(event) + last_occurrence_char