Skip to content

Commit

Permalink
Merge pull request #1446 from innovationacademy-kr/common/feat_time_r…
Browse files Browse the repository at this point in the history
…esponse#1444

[BE] HOTFIX: MyProfile에 현재시간 형식에 맞게 출력
  • Loading branch information
YESHYUNGSEOK authored Nov 27, 2023
2 parents a7b7e31 + 0d422a4 commit 607018b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.ftclub.cabinet.dto;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.ftclub.cabinet.user.domain.LentExtension;
Expand All @@ -16,5 +18,8 @@ public class MyProfileResponseDto {
private final String name;
private final Long cabinetId;
private final LocalDateTime unbannedAt;
private final String date = LocalDateTime.now().format(
DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss 'KST'", Locale.US)
);
private final LentExtensionResponseDto lentExtensionResponseDto;
}
6 changes: 4 additions & 2 deletions frontend/src/pages/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ const Layout = (): JSX.Element => {
try {
const {
data: myInfo,
headers: { date: serverTime },
data: { date: serverTime },
} = await axiosMyInfo();
setServerTime(new Date(serverTime)); // 접속 후 최초 서버 시간을 가져옴

const formattedServerTime = serverTime.split(" KST")[0];
setServerTime(new Date(formattedServerTime)); // 접속 후 최초 서버 시간을 가져옴
setMyInfoData(myInfo);
setUser(myInfo);
setIsValidToken(true);
Expand Down

0 comments on commit 607018b

Please sign in to comment.