diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/MyRoutineList.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/MyRoutineList.java index 2abdd86a..7842028c 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/MyRoutineList.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/MyRoutineList.java @@ -8,6 +8,9 @@ import lombok.extern.slf4j.Slf4j; import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -56,7 +59,12 @@ private static List checkRoutine(MyVeggie myVeggie){ private static Boolean signRoutineCheck(Date date){ boolean check = true; - if (date.equals(LocalDate.now())) { + LocalDate currentDate = LocalDate.now(); + LocalTime fixedTime = LocalTime.of(0, 0, 0, 0); + LocalDateTime dateTime = LocalDateTime.of(currentDate, fixedTime); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S"); + String formattedDateTime = dateTime.format(formatter); + if (date.equals(formattedDateTime)) { check = false; } log.info(String.valueOf(date)); diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/MyVeggieRoutine.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/MyVeggieRoutine.java index 53f18d05..fa456534 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/MyVeggieRoutine.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/MyVeggieRoutine.java @@ -10,6 +10,9 @@ import org.springframework.stereotype.Component; import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.List; @@ -52,7 +55,12 @@ public static List processData(List routineList){ private static Boolean signRoutineCheck(Date date){ boolean check = true; - if (date.equals(LocalDate.now())) { + LocalDate currentDate = LocalDate.now(); + LocalTime fixedTime = LocalTime.of(0, 0, 0, 0); + LocalDateTime dateTime = LocalDateTime.of(currentDate, fixedTime); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S"); + String formattedDateTime = dateTime.format(formatter); + if (date.equals(formattedDateTime)) { check = false; } log.info(String.valueOf(date));