refactor(frontend-temp): schedules.js에서 dayjs 활용
- datetime 파싱에 dayjs 사용 - utils/date.js에서 timezone 설정된 dayjs import Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4dcd79504d
commit
2ead24065b
1 changed files with 5 additions and 4 deletions
|
|
@ -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 배열을 문자열로 (기존 코드 호환성)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue