1.1 --- a/imiptools/data.py Sun Oct 15 18:39:24 2017 +0200
1.2 +++ b/imiptools/data.py Sun Oct 15 21:34:23 2017 +0200
1.3 @@ -1147,7 +1147,8 @@
1.4 # must start from the first period, filtering from a start date must be
1.5 # done after the instances have been obtained.
1.6
1.7 - for recurrence_start in selector.materialise(dtstart, end, parameters.get("COUNT"), parameters.get("BYSETPOS"), inclusive):
1.8 + for recurrence_start in selector.materialise(dtstart, end,
1.9 + parameters.get("COUNT"), parameters.get("BYSETPOS"), inclusive):
1.10
1.11 # Determine the resolution of the period.
1.12
1.13 @@ -1160,6 +1161,11 @@
1.14
1.15 period = RecurringPeriod(recurrence_start, recurrence_end, tzid, "RRULE", dtstart_attr)
1.16
1.17 + # Use the main period where it occurs.
1.18 +
1.19 + if period == main_period:
1.20 + period = main_period
1.21 +
1.22 # Filter out periods before the start.
1.23
1.24 if period.within(selection_period):