public Date getEndTime() {
Date endTime;
if (this.isRecurring) {
if (this.isRepeatDuration) {
DurationItem repeatDurationItem = (DurationItem) this.repeatForm.getItem(FIELD_REPEAT_DURATION);
if (repeatDurationItem.getUnitType() == UnitType.ITERATIONS) {
// n repetitions
endTime = null;
} else {
// n units of time - compute end time
long delay = repeatDurationItem.getValueAsLong() * 1000;
long endTimestamp = System.currentTimeMillis() + delay;
endTime = new Date(endTimestamp);
}
} else if (this.isEndTime) {
DateTimeItem endTimeItem = (DateTimeItem) this.repeatForm.getField(FIELD_END_TIME);