if (periodRange.includesDate(occurrence)) {
GenericValue cloneWorkEffort = (GenericValue) workEffort.clone();
TimeDuration duration = TimeDuration.fromNumber(workEffort.getDouble("estimatedMilliSeconds"));
if (!duration.isZero()) {
Calendar endCal = UtilDateTime.toCalendar(occurrence, timeZone, locale);
Date endDate = duration.addToCalendar(endCal).getTime();
cloneWorkEffort.set("estimatedStartDate", new Timestamp(occurrence.getTime()));
cloneWorkEffort.set("estimatedCompletionDate", new Timestamp(endDate.getTime()));
} else {
cloneWorkEffort.set("estimatedStartDate", periodRange.startStamp());
cloneWorkEffort.set("estimatedCompletionDate", periodRange.endStamp());