Skip to content

Commit

Permalink
Merge pull request #97 from nalpch/recurring-and-floating-events
Browse files Browse the repository at this point in the history
Recurring and floating events
  • Loading branch information
eigenmannmartin authored Dec 18, 2022
2 parents 2f82ffe + 53817cc commit c0c9c46
Show file tree
Hide file tree
Showing 6 changed files with 548 additions and 2,595 deletions.
15 changes: 11 additions & 4 deletions icalevents/icalevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def events(
end=None,
fix_apple=False,
http=None,
sort=True,
tzinfo=None,
sort=None,
strict=False,
) -> list[Event]:
"""
Get all events form the given iCal URL occurring in the given time range.
Expand All @@ -31,9 +33,12 @@ def events(
:param start: start date (see dateutils.date)
:param end: end date (see dateutils.date)
:param fix_apple: fix known Apple iCal issues
:sort: sorts events by start time
:param tzinfo: return values in specified tz
:param sort: sort return values
:param strict: return dates, datetimes and datetime with timezones as specified in ical
:sort sorts events by start time
:return: events
:return events
"""
found_events = []

Expand All @@ -49,7 +54,9 @@ def events(
if not content and string_content:
content = ical_download.data_from_string(string_content, apple_fix=fix_apple)

found_events += parse_events(content, start=start, end=end)
found_events += parse_events(
content, start=start, end=end, tzinfo=tzinfo, sort=sort, strict=strict
)

if found_events is not None and sort is True:
found_events.sort()
Expand Down
Loading

0 comments on commit c0c9c46

Please sign in to comment.