From 2ead24065b999099e14531e474c791aef990026d Mon Sep 17 00:00:00 2001 From: caadiq Date: Thu, 22 Jan 2026 09:01:24 +0900 Subject: [PATCH] =?UTF-8?q?refactor(frontend-temp):=20schedules.js?= =?UTF-8?q?=EC=97=90=EC=84=9C=20dayjs=20=ED=99=9C=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - datetime 파싱에 dayjs 사용 - utils/date.js에서 timezone 설정된 dayjs import Co-Authored-By: Claude Opus 4.5 --- frontend-temp/src/api/schedules.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend-temp/src/api/schedules.js b/frontend-temp/src/api/schedules.js index 69c1cba..26fed66 100644 --- a/frontend-temp/src/api/schedules.js +++ b/frontend-temp/src/api/schedules.js @@ -2,7 +2,7 @@ * 스케줄 API */ import { fetchApi, fetchAuthApi, fetchFormData } from './client'; -import { getTodayKST } from '@/utils'; +import { getTodayKST, dayjs } from '@/utils'; /** * API 응답을 프론트엔드 형식으로 변환 @@ -17,9 +17,10 @@ function transformSchedule(schedule) { let date = ''; let time = null; if (schedule.datetime) { - const parts = schedule.datetime.split('T'); - date = parts[0]; - time = parts[1] || null; + const dt = dayjs(schedule.datetime); + date = dt.format('YYYY-MM-DD'); + // datetime에 T가 포함되어 있으면 시간이 있는 것 + time = schedule.datetime.includes('T') ? dt.format('HH:mm:ss') : null; } // members 배열을 문자열로 (기존 코드 호환성)