Skip to content

Commit

Permalink
Merge pull request #14 from arturom/byday_fix_for_week
Browse files Browse the repository at this point in the history
Applied BYDAY fix to events using a DAILY FREQ rule
  • Loading branch information
irgangla authored Feb 26, 2018
2 parents d709e0e + b4cb150 commit 42afe9e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions icalevents/icalparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,16 @@ def create_recurring_events(start, end, component):
if freq == 'DAILY':
delta = timedelta(days=1)
elif freq == 'WEEKLY':
by_day = rule.get('BYDAY')
if by_day:
day_deltas = generate_day_deltas_by_weekday(set(by_day))
else:
delta = timedelta(days=7)
day_deltas = None
delta = timedelta(days=7)
else:
return

by_day = rule.get('BYDAY')
if by_day:
day_deltas = generate_day_deltas_by_weekday(set(by_day))
else:
day_deltas = None

while True:
if day_deltas is not None:
delta = timedelta(days=day_deltas.get(current.start.weekday()))
Expand Down

0 comments on commit 42afe9e

Please sign in to comment.