Date end = new DateTime(start).plusHours(durationHours).plusMinutes(durationMinutes).toDate();
return createEvent(id, false, start, end);
}
private BasicEvent createEvent(int id, boolean allDay, Date start, Date end) {
BasicCategorizedEvent event = new BasicCategorizedEvent();
StringBuffer title = new StringBuffer();
//title.append("Event");
title.append(" #").append(id);
if (allDay) {
title.append(" [").append(DATE_FORMAT.format(start));
if (end != null) {
title.append(" - ").append(DATE_FORMAT.format(end));
}
} else {
title.append(" [").append(TIME_FORMAT.format(start));
if (end != null) {
title.append(" - ").append(TIME_FORMAT.format(end));
}
}
title.append("]");
event.setTitle(title.toString());
event.setAllDayEvent(allDay);
event.setStartTime(start);
event.setEndTime(end);
event.setCssClassForCategory("cat" + ((mRandom.nextInt(3)) + 1));
return event;
}