From aa4f4a91c4df5744342ad797ca283272f3104251 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Fri, 20 Aug 2021 11:44:30 +0400 Subject: [PATCH] #9 -- fix dates --- src/main/java/ru/ulstu/controller/IndexController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/ru/ulstu/controller/IndexController.java b/src/main/java/ru/ulstu/controller/IndexController.java index 0bc59df..2a471dc 100644 --- a/src/main/java/ru/ulstu/controller/IndexController.java +++ b/src/main/java/ru/ulstu/controller/IndexController.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.time.format.DateTimeFormatter; import java.util.List; -import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; @@ -74,9 +73,10 @@ public class IndexController { ModelingResult modelingResult = timeSeriesService.getForecast(timeSeries, countForecastPoints); TimeSeries forecast = modelingResult.getTimeSeries(); TimeSeries testForecast = modelingResult.getTestForecast(); - Set dates = timeSeries.getValues().stream() + List dates = timeSeries.getValues().stream() .map(v -> v.getDate().format(DateTimeFormatter.ISO_DATE)) - .collect(Collectors.toSet()); + .distinct() + .collect(Collectors.toList()); dates.addAll(forecast.getValues().stream() .map(v -> v.getDate().format(DateTimeFormatter.ISO_DATE)) .collect(Collectors.toSet()));