Use #getCapacityDurationAt for calculating the capacity between two dates

FEA: ItEr60S19TimeUnitDataType
This commit is contained in:
Óscar González Fernández 2010-08-30 15:53:03 +02:00
parent e887942893
commit b1995f3b8e

View file

@ -66,12 +66,12 @@ public class ResourceCalendar extends BaseCalendar {
}
public Integer getCapacity(LocalDate from, LocalDate to) {
Integer result = getCapacityAt(to);
EffortDuration result = getCapacityDurationAt(to);
for (LocalDate date = from; date.isBefore(to);) {
result += getCapacityAt(date);
result = result.plus(getCapacityDurationAt(date));
date = date.plusDays(1);
}
return result;
return roundToHours(result);
}
@Override