Skip to content

Commit

Permalink
chore: 기념일 반환시 날짜까지만 반환되도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
qormoon committed Jun 28, 2024
1 parent 6230ef9 commit b44124c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ public class AnniversaryResponseDTO {
private List<Map<String, Integer>> dDays;

public static AnniversaryResponseDTO of(Anniversary anniversary, List<Map<String, Integer>> dDays) {
String fullDate = anniversary.getAnniversaryDate().toString();
String formattedDate = fullDate.substring(0, 10); // "yyyy-MM-dd" 형식으로 자르기

return AnniversaryResponseDTO.builder()
.id(anniversary.getId())
.name(anniversary.getName())
.anniversaryDate(anniversary.getAnniversaryDate().toString())
.anniversaryDate(formattedDate)
.type(anniversary.getType().name())
.dDays(dDays)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static MemberResponseDTO of(Member member) {
.map(anniversary -> Map.<String, Object>of(
"id", anniversary.getId(),
"name", anniversary.getName(),
"anniversaryDate", anniversary.getAnniversaryDate().toString(),
"anniversaryDate", anniversary.getAnniversaryDate().toString().substring(0,10),
"type", anniversary.getType().name(),
"d-day", anniversaryService.calculateDDay(anniversary)
))
Expand Down

0 comments on commit b44124c

Please sign in to comment.