mangstadt / biweekly

biweekly is an iCalendar library written in Java.
BSD 2-Clause "Simplified" License
323 stars 44 forks source link

Is possible to set custom ICalDataType? #70

Closed MarcoMerlo closed 7 years ago

MarcoMerlo commented 7 years ago

Hi @mangstadt great library!

I was trying to write "X-ALT-DESC" property to an event but I can't find a way to set the ICalDataType correctly. I need to write "X-ALT-DESC;FMTTYPE=text/html:all my very bad html goes here" to the ics file but there is no corresponding type.

Is there a way to do that or I need to extend with custom property and scriber?

Thank you in advance

Marco

mangstadt commented 7 years ago

Hi @MarcoMerlo. I'm glad you like biweekly! :grin:

Simply add a RawProperty to your event, like so:

VEvent event = ...
RawProperty property = new RawProperty("X-ALT-DESC", "all my very bad html goes here");
property.addParameter("FMTTYPE", "text/html");
event.addProperty(property);
MarcoMerlo commented 7 years ago

thank you sooo much! I'm new to the library, and I didn' think about parameters...

mangstadt commented 7 years ago

No problem! :tada: