diff --git a/api/pom.xml b/api/pom.xml index 6d4432d5..9821bf35 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -7,7 +7,7 @@ ca.bc.gov.educ educ-grad-report-api educ-grad-report-api - 1.8.65 + 1.8.66 Ministry of Education and Child Care REPORT API diff --git a/api/src/main/java/ca/bc/gov/educ/grad/report/utils/GradLocalDateDeserializer.java b/api/src/main/java/ca/bc/gov/educ/grad/report/utils/GradLocalDateDeserializer.java index 8b62a2d4..f88523b8 100644 --- a/api/src/main/java/ca/bc/gov/educ/grad/report/utils/GradLocalDateDeserializer.java +++ b/api/src/main/java/ca/bc/gov/educ/grad/report/utils/GradLocalDateDeserializer.java @@ -11,6 +11,7 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.format.DateTimeFormatter; +import java.time.temporal.TemporalAdjusters; import static ca.bc.gov.educ.grad.report.utils.EducGradReportApiConstants.SECOND_DEFAULT_DATE_FORMAT; @@ -34,7 +35,7 @@ public LocalDate deserialize(JsonParser jsonParser, DeserializationContext deser if(slashCount > 0) { formatter = DateTimeFormatter.ofPattern(SECOND_DEFAULT_DATE_FORMAT); } - return LocalDate.parse(dateAsString, formatter); + return LocalDate.parse(dateAsString, formatter).with(TemporalAdjusters.lastDayOfMonth()); } else if(jsonParser.hasToken(JsonToken.VALUE_NUMBER_INT)) { long timestamp = jsonParser.getValueAsLong(); return LocalDate.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault()); diff --git a/api/src/main/java/ca/bc/gov/educ/grad/report/utils/GradLocalDateTimeDeserializer.java b/api/src/main/java/ca/bc/gov/educ/grad/report/utils/GradLocalDateTimeDeserializer.java index 3ea0885c..faa96932 100644 --- a/api/src/main/java/ca/bc/gov/educ/grad/report/utils/GradLocalDateTimeDeserializer.java +++ b/api/src/main/java/ca/bc/gov/educ/grad/report/utils/GradLocalDateTimeDeserializer.java @@ -12,6 +12,7 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; +import java.time.temporal.TemporalAdjusters; import static ca.bc.gov.educ.grad.report.utils.EducGradReportApiConstants.*; @@ -35,7 +36,7 @@ public LocalDateTime deserialize(JsonParser jsonParser, DeserializationContext d if(slashCount > 0) { formatter = DateTimeFormatter.ofPattern(SECOND_DEFAULT_DATE_FORMAT); } - return LocalDateTime.parse(dateAsString, formatter); + return LocalDateTime.parse(dateAsString, formatter).with(TemporalAdjusters.lastDayOfMonth()); } else if(jsonParser.hasToken(JsonToken.VALUE_NUMBER_INT)) { long timestamp = jsonParser.getValueAsLong(); return LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault());