Add basic event summary and description
Summary is the title of the event in your calendar, so we want it to be a little less verbose.
This commit is contained in:
parent
9f45f06092
commit
82b734d1a8
@ -13,6 +13,7 @@ def add_vevent(cal: VCalendar2_0, reservation: Reservation):
|
||||
vevent.add('dtstart').value = reservation.start
|
||||
vevent.add('dtend').value = reservation.end
|
||||
vevent.add('summary').value = reservation.summary
|
||||
vevent.add('description').value = reservation.description
|
||||
return cal
|
||||
|
||||
|
||||
|
@ -14,4 +14,12 @@ class Reservation(object):
|
||||
start: pendulum.DateTime
|
||||
end: pendulum.DateTime
|
||||
comments: str
|
||||
summary: str
|
||||
raw: str
|
||||
|
||||
@property
|
||||
def summary(self):
|
||||
return f"Flying {self.aircraft} with {self.instructor}"
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
return self.raw
|
||||
|
@ -90,7 +90,7 @@ def make_reservation_from_tag(tag: Tag) -> Reservation:
|
||||
strict=False,
|
||||
tz=config.TIME_ZONE)
|
||||
attributes[datetime_attr] = parsed_datetime
|
||||
attributes['summary'] = raw
|
||||
attributes['raw'] = raw.replace('\r', '').replace('\t', '')
|
||||
return Reservation(**attributes)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user