Skip to content

Commit

Permalink
fix - #58 날짜 차이 구하는 로직 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
kseysh committed Jan 16, 2024
1 parent 7b7d282 commit a319141
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void modifyDailyChallengeStatus(Long userId, List<AppUsageTimeRequest> 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);
}
Expand Down

0 comments on commit a319141

Please sign in to comment.