return obj;
}
private static VEvent convertEventBean(EventBean event) {
Date begin;
Date end;
if (event.isAllDay()) {
begin = new Date(event.getBegin().toCalendar(new Locale("pt")).getTime());
end = new Date(event.getEnd().toCalendar(new Locale("pt")).getTime());
} else {
begin = new DateTime(event.getBegin().toCalendar(new Locale("pt")).getTime());
end = new DateTime(event.getEnd().toCalendar(new Locale("pt")).getTime());
}
VEvent vEvent = new VEvent(begin, end, event.getTitle());
vEvent.getStartDate().setTimeZone(TIMEZONE);
vEvent.getEndDate().setTimeZone(TIMEZONE);
if (event.getLocation() != null) {
vEvent.getProperties().add(new Location(event.getLocation()));
}
if (event.getUrl() != null) {
try {
vEvent.getProperties().add(new Url(new URI(event.getUrl())));
} catch (URISyntaxException e) {
}
}
if (event.getNote() != null) {
vEvent.getProperties().add(new Description(event.getNote()));
}
Uid uid = new Uid(digest(event.getTitle() + "-" + begin.toGMTString() + "-" + end.toGMTString()));
vEvent.getProperties().add(uid);
return vEvent;
}