Skip to content

Commit

Permalink
chore - #117 toLocalDate와 toString 사용해서 시작날짜 반환하게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jumining committed May 20, 2024
1 parent 8301f74 commit 0b88979
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,14 @@ public ChallengeResponse getChallenge(Long userId) {
Challenge challenge = findCurrentChallengeByUserId(userId);
Integer todayIndex = calculateTodayIndex(challenge.getCreatedAt(), challenge.getPeriod());

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedStartDate = challenge.getCreatedAt().format(formatter);

return ChallengeResponse.builder()
.period(challenge.getPeriod())
.statuses(challenge.getHistoryDailyChallenges()
.stream()
.map(DailyChallenge::getStatus)
.toList())
.todayIndex(todayIndex)
.startDate(formattedStartDate)
.startDate(challenge.getCreatedAt().toLocalDate().toString())
.goalTime(challenge.getGoalTime())
.apps(challenge.getApps().stream()
.map(app -> new AppGoalTimeResponse(app.getAppCode(), app.getGoalTime())).toList())
Expand Down

0 comments on commit 0b88979

Please sign in to comment.