ical2csv icon indicating copy to clipboard operation
ical2csv copied to clipboard

TypeError when converting to csv

Open ifuchs opened this issue 3 years ago • 2 comments

I exported my ical calendar and then tried to use ical2csv and got the following error:

Traceback (most recent call last): File "ical2csv.py", line 90, in sortedevents=sorted(events, key=lambda obj: obj.start) # Needed to sort events. They are not fully chronological in a Google Calendard export ... TypeError: can't compare datetime.datetime to datetime.date

ifuchs avatar Apr 26 '21 14:04 ifuchs

I have a feeling some of the latest changes/fixes in ical2txt.py will fix this. I'll have a look soon.

martinm76 avatar Apr 26 '21 20:04 martinm76

Okay, I have a pull request pending that fixes this, as well as bringing feature parity between ical2csv and ical2txt. It seems some events, probably all day events, return datetime.date instead of datetime.datetime objects. I have implemented a check where I can convert these to datetime.datetime, and tested on years of calendar events. Seems to work fine now.

martinm76 avatar May 02 '21 16:05 martinm76