Skip to content

Commit

Permalink
fix : closeTime 시간 형식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunWoo9930 committed Dec 6, 2024
1 parent 6cf1e39 commit 81d3ddf
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import com.jangburich.domain.store.domain.Category;
import com.querydsl.core.annotations.QueryProjection;

import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

import lombok.Builder;

@Builder
Expand Down Expand Up @@ -33,9 +36,18 @@ public SearchStoresResponse(Long storeId, String name, Double latitude, Double l
category.getDisplayName(),
distance,
businessStatus,
closeTime,
formatCloseTime(closeTime),
phoneNumber,
imageUrl
);
}
}

private static String formatCloseTime(String closeTime) {
try {
LocalTime time = LocalTime.parse(closeTime.split("\\.")[0]);
return time.format(DateTimeFormatter.ofPattern("HH:mm"));
} catch (Exception e) {
return closeTime;
}
}
}

0 comments on commit 81d3ddf

Please sign in to comment.