1.1 --- a/imiptools/data.py Mon Oct 19 14:52:02 2015 +0200
1.2 +++ b/imiptools/data.py Mon Oct 19 18:19:50 2015 +0200
1.3 @@ -190,17 +190,18 @@
1.4
1.5 # Computed results.
1.6
1.7 - def get_main_period(self, tzid):
1.8 + def get_main_period(self, tzid=None):
1.9
1.10 """
1.11 Return a period object corresponding to the main start-end period for
1.12 the object.
1.13 """
1.14
1.15 - (dtstart, dtstart_attr), (dtend, dtend_attr) = self.get_main_period_items(tzid)
1.16 + (dtstart, dtstart_attr), (dtend, dtend_attr) = self.get_main_period_items()
1.17 + tzid = tzid or get_tzid(dtstart_attr, dtend_attr)
1.18 return RecurringPeriod(dtstart, dtend, tzid, "DTSTART", dtstart_attr, dtend_attr)
1.19
1.20 - def get_main_period_items(self, tzid):
1.21 + def get_main_period_items(self):
1.22
1.23 """
1.24 Return two (value, attributes) items corresponding to the main start-end
1.25 @@ -417,7 +418,7 @@
1.26 main_changed = False
1.27
1.28 for p in periods:
1.29 - if p.origin == "RDATE":
1.30 + if p.origin == "RDATE" and p != self.get_main_period():
1.31 new_rdates.append(get_period_item(p.get_start(), p.get_end()))
1.32 elif p.origin == "DTSTART":
1.33 main_changed = self.set_period(p)