Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 108/미션 인증 목록 조회 수정 #109

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.modernfarmer.farmusspring.domain.farmclub.util;

import java.time.LocalDateTime;

public class DateUtil {

// LocalDateTime(2024-07-05 09:46:34.342303) -> String(yy.mm.dd hh:mm)
public static String localDateTimeFormat(LocalDateTime date) {
return date.getYear() % 100 + "." +
date.getMonthValue() + "." +
date.getDayOfMonth() + " " +
date.getHour() + ":" +
date.getMinute();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
import com.modernfarmer.farmusspring.domain.user.entity.User;
import com.querydsl.core.annotations.QueryProjection;

import static com.modernfarmer.farmusspring.domain.farmclub.util.DateUtil.localDateTimeFormat;

public record MissionPostVo(
Long missionPostId,
int stepNum,
String nickname,
String profileImage,
String date,
Expand All @@ -20,9 +23,10 @@ public MissionPostVo(MissionPost missionPost, User user, Long likeCount, Long co
{
this(
missionPost.getId(),
missionPost.getStepNum(),
user.getNickname(),
user.getProfileImage(),
missionPost.getCreatedDate().toString(),
localDateTimeFormat(missionPost.getCreatedDate()),
missionPost.getImage(),
missionPost.getContent(),
likeCount,
Expand Down
Loading