1.1 --- a/imiptools/dates.py Sat May 16 18:26:55 2015 +0200
1.2 +++ b/imiptools/dates.py Sat May 16 20:02:09 2015 +0200
1.3 @@ -399,4 +399,28 @@
1.4
1.5 return format_datetime(to_utc_datetime(get_datetime(recurrenceid), tzid))
1.6
1.7 +def end_date_to_calendar(dt):
1.8 +
1.9 + """
1.10 + Change end dates to refer to the iCalendar "next day" dates, not the actual
1.11 + dates.
1.12 + """
1.13 +
1.14 + if not isinstance(dt, datetime):
1.15 + return dt + timedelta(1)
1.16 + else:
1.17 + return dt
1.18 +
1.19 +def end_date_from_calendar(dt):
1.20 +
1.21 + """
1.22 + Change end dates to refer to the actual dates, not the iCalendar "next day"
1.23 + dates.
1.24 + """
1.25 +
1.26 + if not isinstance(dt, datetime):
1.27 + return dt - timedelta(1)
1.28 + else:
1.29 + return dt
1.30 +
1.31 # vim: tabstop=4 expandtab shiftwidth=4