fix: [holidays] 대량 등록 모달에 기존 등록 데이터 표시

- 해당 연도에 등록된 휴일이 있으면 기존 데이터를 텍스트 형식으로 표시
- 등록된 데이터가 없을 때만 기본 공휴일 예시 표시
This commit is contained in:
김보곤
2026-02-26 14:34:00 +09:00
parent 84fe893a5b
commit b8b2e7e023

View File

@@ -258,6 +258,16 @@ function HolidayManagement() {
};
const getDefaultBulkText = () => {
// 해당 연도에 등록된 데이터가 있으면 기존 데이터를 텍스트로 변환
if (holidays.length > 0) {
const typeLabels = { public: '공휴일', company: '회사지정', alternative: '대체휴일', temporary: '임시휴일' };
return holidays.map(h => {
const datePart = h.startDate === h.endDate ? h.startDate : `${h.startDate}~${h.endDate}`;
const typePart = h.type !== 'public' ? ` [${typeLabels[h.type] || h.type}]` : '';
return `${datePart} ${h.name}${typePart}`;
}).join('\n');
}
// 등록된 데이터가 없으면 기본 공휴일 예시
const y = selectedYear;
return `${y}-01-01 신정
${y}-01-28~${y}-01-30 설날연휴