public static ZoomLevel calculateDefaultLevel(
PlannerConfiguration<TaskElement> configuration) {
if (configuration.getData().isEmpty()) {
return ZoomLevel.DETAIL_ONE;
}
TaskElement earliest = Collections.min(configuration.getData(),
TaskElement
.getByStartDateComparator());
TaskElement latest = Collections.max(configuration.getData(),
TaskElement.getByEndAndDeadlineDateComparator());
LocalDate startDate = earliest.getStartAsLocalDate();
LocalDate endDate = latest.getBiggestAmongEndOrDeadline();
return ZoomLevel.getDefaultZoomByDates(startDate, endDate);
}