mangstadt / biweekly

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

Boolean allDay #45

Closed valentinlourteau closed 8 years ago

valentinlourteau commented 8 years ago

Hi,

I am using biweekly to add events on Outlook, it works fine but i can't find any boolean "all day event". Without this boolean, i can't set the related checkbox in outlook even if my dateStart and dateEnd are ok.

Waiting to hear from you, Yours sincerely

mangstadt commented 8 years ago

Hello,

The iCalendar specifications do not define a way to mark an event as an "all day event", which is why biweekly doesn't have a boolean for it.

I don't know how Outlook determines if an event is an "all day event" or not. To find out, you could try creating an all day event in Outlook and then exporting it to a .ics file.

One possible solution is to define the start date as a date without a time component, and do not set an end date, like so:

VEvent event = new VEvent();
Date start = ...
event.setDateStart(start, false);

Please let me know if this information was helpful to you.

Thank you, Mike

valentinlourteau commented 8 years ago

Hello,

Thanks for your answer which solved my problem. The solution is to set DateStart with the boolean hasTime to false and to leave dateEnd empty. Outlook now recognize my event as an allday event.

I'd like to congratulate you for the library which is really conveniant to use, it tooks me 10 minutes to be able to create fully customizable ics files !

Have a nice day, Valentin

mangstadt commented 8 years ago

Valentin,

Thank you for the kind words. I'm glad you like biweekly!