Fixed time interval aligning

This commit is contained in:
Luca Frosini 2021-11-26 17:24:10 +01:00
parent c37b03e969
commit 41ead0c81c
1 changed files with 6 additions and 1 deletions

View File

@ -151,7 +151,12 @@ public class TemporalConstraint {
}
public Calendar getAlignedEndTime(){
return getAlignedCalendar(endTime, aggregationMode);
Calendar calendar = getAlignedCalendar(endTime, aggregationMode);
int ordinal = aggregationMode.ordinal();
int calendarToAdd = CalendarEnum.values()[ordinal].getCalendarValue();
calendar.add(calendarToAdd, 1);
calendar.add(Calendar.MILLISECOND, -1);
return calendar;
}
public SortedSet<Calendar> getCalendarSequence(){