Skip to content

Commit 54e5e5c

Browse files
authored
Merge pull request #276 from pirogramming/frontend_km
[fix]: 기존 UTC(KST+9) -> KST(한국 기준 시간)로 시간대 변환
2 parents fc3bdd5 + ae530c1 commit 54e5e5c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/src/pages/generation/Attendance.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const Attendance = () => {
111111

112112
if (!userId) return;
113113

114-
const today = new Date().toISOString().split("T")[0]; // YYYY-MM-DD
114+
const today = new Date().toLocaleDateString("sv-SE"); // → KST(한국 시간 기준)
115115
const res = await api.get(`/attendance/user/date`, {
116116
params: { userId, date: today },
117117
withCredentials: true, // 세션 기반 인증 요청처리
@@ -139,7 +139,7 @@ const Attendance = () => {
139139

140140
useEffect(() => {
141141
if (!currentDateRef.current) {
142-
currentDateRef.current = new Date().toISOString().split("T")[0];
142+
currentDateRef.current = new Date().toLocaleDateString("sv-SE"); // → KST(한국 시간 기준)
143143
}
144144
console.log("currentDateRef 할당 갱신:", currentDateRef.current);
145145

@@ -159,7 +159,7 @@ const Attendance = () => {
159159

160160
// 매 분마다 현재 날짜를 확인해서 달라졌으면 상태 업데이트
161161
const dateCheckInterval = setInterval(() => {
162-
const todayStr = new Date().toISOString().split("T")[0];
162+
const todayStr = new Date().toLocaleDateString("sv-SE"); // → KST(한국 시간 기준)
163163
console.log("dateCheckInterval 실행됨 / 현재 시간:", new Date());
164164
console.log(
165165
"currentDateRef:",

0 commit comments

Comments
 (0)