jazzband / icalevents

Python module for iCal URL/file parsing and querying.
MIT License
157 stars 72 forks source link

Handle multiple recurrence exclude entries on the same EXDATE line #109

Closed mbafford closed 1 year ago

mbafford commented 2 years ago

My company's Exchange server ICS has EXDATE entries in this format (multiple excludes on the same line):

RRULE:FREQ=WEEKLY;UNTIL=20220429T150000Z;INTERVAL=1;BYDAY=FR;WKST=MO
EXDATE;TZID=Eastern Standard Time:20220318T110000,20220401T110000,20220408T
 110000

whereas all existing tests have EXDATE on separate lines - e.g. from recurring.ics test:

RRULE:FREQ=WEEKLY;BYDAY=FR
EXDATE;TZID=Europe/Berlin:20180608T100000
EXDATE;TZID=Europe/Berlin:20180622T100000

This adds a test for my server's format, as well as fixing the code that does not expect component['EXDATE'] to be a vDDDLists object.

Moving exceptions = {} inside the loop brings brings cest.ics test to returning 116 events, but like with #110 , that test is large - I can't easily tell what the "right" answer is (similar problem looks to have affected #110, #97, and #102).

codecov[bot] commented 2 years ago

Codecov Report

Merging #109 (7cd93d5) into master (ed6f30e) will decrease coverage by 0.75%. The diff coverage is 75.00%.

:exclamation: Current head 7cd93d5 differs from pull request most recent head 27198ab. Consider uploading reports for the commit 27198ab to get more accurate results

@@            Coverage Diff             @@
##           master     #109      +/-   ##
==========================================
- Coverage   87.84%   87.08%   -0.76%     
==========================================
  Files           4        4              
  Lines         362      364       +2     
  Branches       93       94       +1     
==========================================
- Hits          318      317       -1     
- Misses         21       22       +1     
- Partials       23       25       +2     
Impacted Files Coverage Δ
icalevents/icalparser.py 87.13% <75.00%> (-1.02%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ed6f30e...27198ab. Read the comment docs.

eigenmannmartin commented 1 year ago

I merged https://github.com/jazzband/icalevents/pull/97 and incooperated this mr. Thank you for the awesome contribution and good catch!