Skip to content

Commit

Permalink
fix data
Browse files Browse the repository at this point in the history
  • Loading branch information
WukAp committed Dec 19, 2024
1 parent 041cf4e commit cf88fdd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.springframework.web.server.ResponseStatusException;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.*;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -45,8 +46,8 @@ public Data getStatistic(
@RequestParam(value = "ageTo", required = false) Integer ageTo,
@RequestParam(value = "limit", required = false) Integer limit,
@RequestParam(value = "breeds", required = false) List<String> breeds) {
Date localDateFrom = dateFrom == null ? null : Date.from(LocalDateTime.parse(dateFrom).toInstant(ZoneOffset.UTC));
Date localDateTo = dateTo == null ? null : Date.from(LocalDateTime.parse(dateTo).toInstant(ZoneOffset.UTC));
Date localDateFrom = dateFrom == null ? null : Date.from(LocalDateTime.parse(dateFrom).atZone(ZoneId.systemDefault()).toInstant());
Date localDateTo = dateTo == null ? null : Date.from(LocalDateTime.parse(dateTo).atZone(ZoneId.systemDefault()).toInstant());
StatisticType statisticType;
try {
statisticType = StatisticType.valueOf(type.toUpperCase());
Expand Down

0 comments on commit cf88fdd

Please sign in to comment.