When end is null (last gap) add 10 years from now
This commit is contained in:
parent
93d34a6a9d
commit
9dbcf0c006
2 changed files with 8 additions and 2 deletions
|
|
@ -46,6 +46,13 @@ public class DateAndHour implements Comparable<DateAndHour> {
|
|||
return new DateAndHour(date.getDate(), date.getEffortDuration().getHours());
|
||||
}
|
||||
|
||||
public static DateAndHour TEN_YEARS_FROM(DateAndHour dateAndHour) {
|
||||
LocalDate date = dateAndHour.getDate() != null ? dateAndHour.getDate() : new LocalDate();
|
||||
DateAndHour result = new DateAndHour(date, dateAndHour.getHour());
|
||||
result.plusYears(10);
|
||||
return result;
|
||||
}
|
||||
|
||||
private LocalDate date;
|
||||
|
||||
private Integer hour;
|
||||
|
|
|
|||
|
|
@ -175,8 +175,7 @@ public class Gap implements Comparable<Gap> {
|
|||
// If endTime is null (last tasks) assume the end is in 10 years from now
|
||||
DateAndHour endDate = getEndTime();
|
||||
if (endDate == null) {
|
||||
endDate = new DateAndHour(realStart);
|
||||
endDate.plusYears(10);
|
||||
endDate = DateAndHour.TEN_YEARS_FROM(realStart);
|
||||
}
|
||||
|
||||
Iterator<PartialDay> daysUntilEnd = realStart.toIntraDayDate()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue