From dbd06cead0df91d11426f665aecfe5be6b7bb315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 20 Mar 2026 10:42:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:[=EA=B7=BC=ED=83=9C=ED=98=84=ED=99=A9]=20?= =?UTF-8?q?=EB=85=84=EB=8F=84/=EC=9B=94=20=EB=93=9C=EB=A1=AD=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20=EB=B3=80=EA=B2=BD=20=EC=8B=9C=20=EC=8B=9C=EC=9E=91?= =?UTF-8?q?=EC=9D=BC=C2=B7=EC=A2=85=EB=A3=8C=EC=9D=BC=20=EC=9E=90=EB=8F=99?= =?UTF-8?q?=20=EA=B0=B1=EC=8B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/hr/attendances/index.blade.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/resources/views/hr/attendances/index.blade.php b/resources/views/hr/attendances/index.blade.php index 7abcf889..22488698 100644 --- a/resources/views/hr/attendances/index.blade.php +++ b/resources/views/hr/attendances/index.blade.php @@ -277,6 +277,27 @@ function loadTabData(tab) { document.getElementById('statsMonth').addEventListener('change', onPeriodChange); function onPeriodChange() { + const year = parseInt(document.getElementById('statsYear').value); + const month = parseInt(document.getElementById('statsMonth').value); + + // 해당 월의 시작일 + const startDate = `${year}-${String(month).padStart(2, '0')}-01`; + + // 해당 월의 마지막 날 계산 (현재 월이면 오늘 날짜) + const now = new Date(); + const isCurrentMonth = (year === now.getFullYear() && month === (now.getMonth() + 1)); + let endDate; + if (isCurrentMonth) { + endDate = now.toISOString().split('T')[0]; + } else { + const lastDay = new Date(year, month, 0).getDate(); + endDate = `${year}-${String(month).padStart(2, '0')}-${String(lastDay).padStart(2, '0')}`; + } + + // 시작일/종료일 입력 필드 업데이트 + document.querySelector('input[name="date_from"]').value = startDate; + document.querySelector('input[name="date_to"]').value = endDate; + refreshStats(); if (tabLoaded.calendar) { tabLoaded.calendar = false;