1.1 --- a/imipweb/data.py Thu Jul 30 22:11:56 2015 +0200
1.2 +++ b/imipweb/data.py Thu Jul 30 22:30:26 2015 +0200
1.3 @@ -273,6 +273,13 @@
1.4 return {"VALUE" : "DATE"}
1.5
1.6 def event_period_from_period(period):
1.7 +
1.8 + """
1.9 + Convert a 'period' to one suitable for use in an iCalendar representation.
1.10 + In an "event period" representation, the end day of any date-level event is
1.11 + encoded as the "day after" the last day actually involved in the event.
1.12 + """
1.13 +
1.14 if isinstance(period, EventPeriod):
1.15 return period
1.16 elif isinstance(period, FormPeriod):
1.17 @@ -285,6 +292,13 @@
1.18 return EventPeriod(dtstart, dtend, period.tzid, period.origin, dtstart_attr, dtend_attr)
1.19
1.20 def form_period_from_period(period):
1.21 +
1.22 + """
1.23 + Convert a 'period' into a representation usable in a user-editable form.
1.24 + In a "form period" representation, the end day of any date-level event is
1.25 + presented in a "natural" form, not the iCalendar "day after" form.
1.26 + """
1.27 +
1.28 if isinstance(period, EventPeriod):
1.29 return period.as_form_period()
1.30 elif isinstance(period, FormPeriod):