1.1 --- a/vRecurrence.py Fri Nov 24 16:59:33 2017 +0100
1.2 +++ b/vRecurrence.py Fri Nov 24 17:09:36 2017 +0100
1.3 @@ -62,8 +62,8 @@
1.4 "YEARLY",
1.5 "MONTHLY",
1.6 "WEEKLY",
1.7 - None,
1.8 - None,
1.9 + None, # yearday has no equivalent frequency
1.10 + None, # monthday has no equivalent frequency
1.11 "DAILY",
1.12 "HOURLY",
1.13 "MINUTELY",
1.14 @@ -278,8 +278,11 @@
1.15 l.append(LimitSelector(0, count, "COUNT"))
1.16
1.17 # Make BYSETPOS sort earlier than the enumeration it modifies.
1.18 + # Other BY... qualifiers sort earlier than selectors at the same resolution
1.19 + # even though such things as "FREQ=HOURLY;BYHOUR=10" do not make much sense.
1.20
1.21 - l.sort(key=lambda x: (x.level, x.qualifier != "BYSETPOS" and 1 or 0))
1.22 + l.sort(key=lambda x: (x.level, not x.qualifier.startswith("BY") and 2 or
1.23 + x.qualifier != "BYSETPOS" and 1 or 0))
1.24 return l
1.25
1.26 def get_datetime_structure(datetime):