feat(project): 날짜 팝업에 일요일·공휴일 빨강, 토요일 파랑
KR_HOLIDAYS 를 Jinja 전역(pj_kr_holidays)으로 두고 공용 사이드바에서 window.PJ_HOLIDAYS 로 넘겨, 프로젝트 관리 모든 화면의 마감일/시작일 팝업(openDatePopover)이 국경일·공휴일·대체공휴일을 빨강으로 칠한다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1515,13 +1515,17 @@ img.pj-person-ic { width: 22px; height: 22px; }
|
||||
.pj-dp-day { z-index: 0; }
|
||||
.pj-dp-day > * { position: relative; }
|
||||
.pj-dp-day:hover::before { background: #f1f2f4; }
|
||||
.pj-dp-day.is-weekend, .pj-dp-day.is-out { color: #8b929b; }
|
||||
.pj-dp-day.is-out { color: #b3b8bf; }
|
||||
/* 일요일·공휴일(국경일·대체공휴일) 빨강, 토요일 파랑 — 다른 달 날짜는 옅게 */
|
||||
.pj-dp-day.is-sun, .pj-dp-wd.is-sun { color: #d93025; }
|
||||
.pj-dp-day.is-sat, .pj-dp-wd.is-sat { color: #1a73e8; }
|
||||
.pj-dp-day.is-out.is-sun { color: #efaaa3; }
|
||||
.pj-dp-day.is-out.is-sat { color: #a8c6f3; }
|
||||
/* 오늘 = 파란 테두리 원 + 굵게 */
|
||||
.pj-dp-day.is-today { font-weight: 800; }
|
||||
.pj-dp-day.is-today::before { border: 1.5px solid #4573d2; }
|
||||
/* 선택 = 파란 원 + 흰 글자 (숫자가 원 위에 보이도록 글자는 z 위로) */
|
||||
.pj-dp-day.is-selected { color: #fff; font-weight: 600; }
|
||||
.pj-dp-day.is-selected, .pj-dp-day.is-selected.is-sun, .pj-dp-day.is-selected.is-sat { color: #fff; font-weight: 600; }
|
||||
.pj-dp-day.is-selected::before { background: #4573d2; border: 0; }
|
||||
.pj-dp-day.is-inrange { background: #e8effb; }
|
||||
.pj-dp-day { isolation: isolate; }
|
||||
|
||||
+14
-3
@@ -256,6 +256,9 @@
|
||||
const same = d.getFullYear() === new Date().getFullYear();
|
||||
return (same ? "" : d.getFullYear() + "년 ") + (d.getMonth() + 1) + "월 " + d.getDate() + "일";
|
||||
}
|
||||
function pageHolidays() {
|
||||
try { return JSON.parse((el("pj-data") || {}).textContent || "{}").holidays || {}; } catch (_) { return {}; }
|
||||
}
|
||||
function openDatePopover(anchor, opts) {
|
||||
closeDatePopover();
|
||||
const today = isoToday();
|
||||
@@ -265,6 +268,8 @@
|
||||
let active = "due";
|
||||
const base = new Date((due || start || today) + "T00:00:00");
|
||||
let viewY = base.getFullYear(), viewM = base.getMonth();
|
||||
// 공휴일 표 — 공용 사이드바가 넘긴 것(모든 프로젝트 화면), 없으면 프로젝트 화면 데이터.
|
||||
const holidays = window.PJ_HOLIDAYS || pageHolidays();
|
||||
|
||||
const pop = document.createElement("div");
|
||||
pop.className = "pj-datepop";
|
||||
@@ -289,11 +294,15 @@
|
||||
const iso = isoOf(d);
|
||||
const cls = ["pj-dp-day"];
|
||||
if (d.getMonth() !== viewM) cls.push("is-out");
|
||||
if (d.getDay() === 0 || d.getDay() === 6) cls.push("is-weekend");
|
||||
// 일요일·공휴일(국경일·대체공휴일 포함) = 빨강, 토요일 = 파랑. 공휴일 이름은 말풍선.
|
||||
const holName = holidays[iso] || "";
|
||||
if (d.getDay() === 0 || holName) cls.push("is-sun");
|
||||
else if (d.getDay() === 6) cls.push("is-sat");
|
||||
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");
|
||||
days += '<button type="button" class="' + cls.join(" ") + '" data-iso="' + iso + '">' + d.getDate() + "</button>";
|
||||
days += '<button type="button" class="' + cls.join(" ") + '" data-iso="' + iso + '"' +
|
||||
(holName ? ' data-tip="' + escapeHtml(holName) + '"' : "") + ">" + d.getDate() + "</button>";
|
||||
}
|
||||
pop.innerHTML =
|
||||
'<div class="pj-dp-fields">' +
|
||||
@@ -308,7 +317,9 @@
|
||||
'<button type="button" class="pj-dp-navbtn" data-nav="1" title="다음 달"><span class="material-symbols-outlined">chevron_right</span></button>' +
|
||||
"</div>" +
|
||||
'<div class="pj-dp-grid">' +
|
||||
["일", "월", "화", "수", "목", "금", "토"].map(function (w) { return '<span class="pj-dp-wd">' + w + "</span>"; }).join("") +
|
||||
["일", "월", "화", "수", "목", "금", "토"].map(function (w, i) {
|
||||
return '<span class="pj-dp-wd' + (i === 0 ? " is-sun" : i === 6 ? " is-sat" : "") + '">' + w + "</span>";
|
||||
}).join("") +
|
||||
days +
|
||||
"</div>" +
|
||||
'<div class="pj-dp-foot">' +
|
||||
|
||||
Reference in New Issue
Block a user