Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple ICS entries in one file. #19

Open
shymega opened this issue Aug 27, 2017 · 5 comments
Open

Support multiple ICS entries in one file. #19

shymega opened this issue Aug 27, 2017 · 5 comments

Comments

@shymega
Copy link

shymega commented Aug 27, 2017

I'm using this library alongside with vdirsyncer and the single file storage backend.

I would like to get this library to parse a whole file with the entries in, but it does not seem to work.

This is the error I receive.

iex(1)> ICalendar.from_ics(File.read!("personal.ics"))
** (MatchError) no match of right hand side value: {:error, "Expected `T`, but found `Z` at line 1, column 9."}
    (icalendar) lib/icalendar/util/deserialize.ex:87: ICalendar.Util.Deserialize.parse_attr/2
    (elixir) lib/enum.ex:1811: Enum."-reduce/3-lists^foldl/2-0-"/3

I have not figured out the issue yet, but I would like to know if its possible to tweak icalendar to support multiple entries of a ICalendar in one file.

@shymega
Copy link
Author

shymega commented Aug 27, 2017

Hmm, it can read/write multiple events. Can't help but wonder if its vdirsyncer or khal..

@lpil
Copy link
Owner

lpil commented Aug 31, 2017

Does it work with other icalendar libraries for other languages?

@shymega
Copy link
Author

shymega commented Sep 1, 2017

@lpil It works fine with Python's icalendar library, but ONLY if you pass the multiple=True option to the Calendar.from_ical() function. Looks like its to do with multiple VCALENDAR entries.

@shymega
Copy link
Author

shymega commented Sep 2, 2017

And the odd thing is, it should work fine. I don't know what the issue is. I haven't tried it in any other language, but I can do. Let me know.

@ericdude4
Copy link
Contributor

Your error seems like a datetime parsing problem. Does your .ics file have any DTSTART or DTEND values in the YYYYMMDD format?

It's fixed by the PR #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants