Skip to content

Commit

Permalink
[merge] 모임 상태와 isOngoing 필드값 동기화되도록 수정
Browse files Browse the repository at this point in the history
[fix] 모임 상태와 isOngoing 필드값 동기화되도록 수정
  • Loading branch information
lreowy authored Sep 20, 2024
2 parents 277bd72 + ec8ea5e commit fe6db10
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.pickple.server.global.exception.CustomException;
import com.pickple.server.global.response.enums.ErrorCode;
import com.pickple.server.global.util.DateTimeUtil;
import com.pickple.server.global.util.DateUtil;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
Expand Down Expand Up @@ -194,7 +193,6 @@ public boolean isMoimSubmissonApproved(Long moimId) {

public boolean isOngoing(Long moimId) {
Moim moim = moimRepository.findMoimByIdOrThrow(moimId);
int day = DateUtil.calculateCompletedDay(moim.getDateList().getDate());
return day >= 0;
return moim.getMoimState().equals("ongoing");
}
}
6 changes: 0 additions & 6 deletions src/main/java/com/pickple/server/global/util/DateUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ public static int calculateDayOfDay(LocalDate date) {
return dday;
}

public static int calculateCompletedDay(LocalDate date) {
LocalDate today = LocalDate.now();
int day = (int) ChronoUnit.DAYS.between(today, date);
return day;
}

public static String refineDate(LocalDate localDate) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd");
return localDate.format(formatter);
Expand Down

0 comments on commit fe6db10

Please sign in to comment.