64

I'm looking for a library to handle iCalendar data in Java.

Open source, well-documented implementations with a good object model are preferred. iCal parsing capabilities are less important to me, but still nice to have.

Does anyone have any recommendations?

David Crow
  • 16,077
  • 8
  • 42
  • 34

2 Answers2

64

A challenger appears! Please give biweekly a try. I'm looking for lots of feedback on how it can be improved.

testing123
  • 11,367
  • 10
  • 47
  • 61
Michael
  • 34,873
  • 17
  • 75
  • 109
  • 6
    I found biweekly much easier to get started with and use for my simple need of generating an ics email attachment. It also has fewer dependencies, which is always nice. – Michael Rush Nov 12 '13 at 18:30
  • Seems good, I tried switching to your library from Ical4j, but the parse function throws a stackOverflowError on large ics files.. But your library is indeed more simple and smaller ;) – Jordy Dec 24 '13 at 10:24
  • @Jordy Thanks for the complements. :) I've fixed the problem you described. It had to do with the way in which the `List.subList()` method was being called. The fix will be included in the next release. Thanks for letting me know about it! :D – Michael Dec 24 '13 at 16:24
  • 1
    +1 json support and "normal" Date/Time handling are benefits, but killer feature was that importing a (large) ics in ical4j failed while biweekly just swallowed it right away ... – Jan Galinski Oct 20 '14 at 11:18
  • +1 nicer to work with than ical4j for processing .ics files.. is there something similar to `net.fortuna.ical4j.model.Component.calculateRecurrenceSet()?` – antak Apr 16 '15 at 06:06
  • 1
    Hi @antak. You can use the `RecurrenceRule.getDateIterator()` method to iterate over all the dates in a recurrence rule. – Michael Apr 19 '15 at 12:46
  • Hi @Michael, I've some issue with updating events maybe you can give a look? http://stackoverflow.com/questions/33675735/how-to-create-and-send-update-to-existing-event-by-uisng-biweekly-library-and-ja And thank you for your work, it's very intuitive to use in comparison with other solutions. – Anatoly Nov 13 '15 at 18:06
  • Hi @Anatoly. See my answer. – Michael Nov 14 '15 at 14:23
  • Here I was thinking I was going to have to parse this by hand. A simple library is just what I needed. Awesome! – Zach Jan 23 '17 at 17:29
  • here my code with biweekly to generate a couple of date start and date end : https://stackoverflow.com/a/56740923/9134193 – mourad m Jul 22 '19 at 14:17
  • It is very easy to use and effective. Thanks man – hossein bakhtiari Jun 12 '21 at 14:28
51

I had limited success with iCal4j (intro) on a project last year.

It seems to be a fairly popular choice for ical work in the java community.

If I remember correctly the API can be slightly confusing at first glance. However It's pretty solid in the long run.

Good luck, Brian

mschr
  • 8,531
  • 3
  • 21
  • 35
Brian Gianforcaro
  • 26,564
  • 11
  • 58
  • 77
  • 1
    I had lots of problems with iCal4J. Weird date time objects, concurrency exceptions (Parser can only be called on the main thread wtf?). Don't recommend it. – Oliver Dixon Apr 04 '17 at 12:23
  • 2
    Agreed. Just tried to use it and it is pretty bad, IMO. Class names shadow standard JDK names (Calendar, Date, etc.). Really strange patterns and odd code smells. Depends on SLF4j. – robross0606 Nov 05 '18 at 19:33