From a319141dc3ac13c2981c854ef057ef686d578852 Mon Sep 17 00:00:00 2001 From: transfer_kk Date: Wed, 17 Jan 2024 01:33:10 +0900 Subject: [PATCH] =?UTF-8?q?fix=20-=20#58=20=EB=82=A0=EC=A7=9C=20=EC=B0=A8?= =?UTF-8?q?=EC=9D=B4=20=EA=B5=AC=ED=95=98=EB=8A=94=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/dailychallenge/service/DailyChallengeService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/sopt/org/HMH/domain/dailychallenge/service/DailyChallengeService.java b/src/main/java/sopt/org/HMH/domain/dailychallenge/service/DailyChallengeService.java index 375fd31c..6fcfd92b 100644 --- a/src/main/java/sopt/org/HMH/domain/dailychallenge/service/DailyChallengeService.java +++ b/src/main/java/sopt/org/HMH/domain/dailychallenge/service/DailyChallengeService.java @@ -73,7 +73,7 @@ public void modifyDailyChallengeStatus(Long userId, List re public DailyChallenge getTodayDailyChallengeByUserId(Long userId) { val challenge = challengeRepository.findFirstByUserIdOrderByCreatedAtDesc(userId); val startDateOfChallenge = challenge.getCreatedAt().toLocalDate(); - val todayDailyChallengeIndex = (int) ChronoUnit.DAYS.between(LocalDateTime.now().toLocalDate(), startDateOfChallenge); + val todayDailyChallengeIndex = (int) ChronoUnit.DAYS.between(startDateOfChallenge, LocalDateTime.now().toLocalDate()); return challenge.getDailyChallenges().get(todayDailyChallengeIndex); }