feat(project): 날짜 팝업 공휴일 숫자 밑에 휴일 이름 표시
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -256,6 +256,7 @@
|
||||
const same = d.getFullYear() === new Date().getFullYear();
|
||||
return (same ? "" : d.getFullYear() + "년 ") + (d.getMonth() + 1) + "월 " + d.getDate() + "일";
|
||||
}
|
||||
const HOLIDAY_SHORT = { "부처님오신날": "석가탄신일", "추석·개천절": "추석" };
|
||||
function pageHolidays() {
|
||||
try { return JSON.parse((el("pj-data") || {}).textContent || "{}").holidays || {}; } catch (_) { return {}; }
|
||||
}
|
||||
@@ -301,8 +302,14 @@
|
||||
if (iso === today) cls.push("is-today");
|
||||
if (iso === due || (showStart && iso === start)) cls.push("is-selected");
|
||||
if (showStart && start && due && iso > start && iso < due) cls.push("is-inrange");
|
||||
// 공휴일은 숫자 밑에 이름. 칸이 좁아 5글자 안쪽으로 줄인다(전체 이름은 말풍선).
|
||||
if (holName) cls.push("has-hol");
|
||||
const holShort = /\s대체$/.test(holName) ? "대체휴일" : (HOLIDAY_SHORT[holName] || holName);
|
||||
days += '<button type="button" class="' + cls.join(" ") + '" data-iso="' + iso + '"' +
|
||||
(holName ? ' data-tip="' + escapeHtml(holName) + '"' : "") + ">" + d.getDate() + "</button>";
|
||||
(holName ? ' data-tip="' + escapeHtml(holName) + '"' : "") + ">" +
|
||||
'<span class="pj-dp-num">' + d.getDate() + "</span>" +
|
||||
(holName ? '<span class="pj-dp-hol">' + escapeHtml(holShort) + "</span>" : "") +
|
||||
"</button>";
|
||||
}
|
||||
pop.innerHTML =
|
||||
'<div class="pj-dp-fields">' +
|
||||
|
||||
Reference in New Issue
Block a user