From 6adb02bf7ef25275ef20dc056acc4be120f44391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Mon, 21 Jul 2025 15:03:54 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A7=90=EC=9D=BC=20=EB=AF=B8=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20alert=20->=2022=EC=9D=BC=20alert=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20=ED=85=8C=EC=8A=A4=ED=8A=B8=EB=A5=BC=20=EC=9C=84=ED=95=B4=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/record/calendar.html | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/front/src/main/resources/templates/record/calendar.html b/front/src/main/resources/templates/record/calendar.html index 3476e604..05376d13 100644 --- a/front/src/main/resources/templates/record/calendar.html +++ b/front/src/main/resources/templates/record/calendar.html @@ -819,15 +819,16 @@ // 오늘 날짜가 해당 달의 마지막 날인지 확인 const today = new Date(); - const lastDayOfMonth = new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 0); // 해당 달의 마지막 날 - // 쿠키에서 마지막 alert 날짜 확인 - const lastAlertDate = getCookie('lastAlertDate'); - const todayDateString = today.toISOString().split('T')[0]; + //const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0); // 해당 달의 마지막 날 + const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth(), 21); // TODO 삭제 테스트를 위해 22일로 수정 + // 마지막 alert 날짜 확인 + const lastAlertDate = sessionStorage.getItem('lastAlertDate'); + const todayDateString = today.toDateString(); + if (lastAlertDate !== todayDateString && today.getFullYear() === lastDayOfMonth.getFullYear() && - today.getMonth() === lastDayOfMonth.getMonth() && + today.getMonth() === lastDayOfMonth.getMonth() && today.getDate() === lastDayOfMonth.getDate()) { - ajaxUtil._ajaxSyncMethod( ENV.httpUrl.alert.replace('{searchMonth}', searchMonth.replace('-', '')), {}, @@ -862,6 +863,7 @@ message: msgTxt, type:'alert', callback: function () { + sessionStorage.setItem('lastAlertDate',lastDayOfMonth.toDateString()); }, }); } @@ -879,20 +881,6 @@ }, }; - // 쿠키 설정 함수 - function setCookie(name, value, days) { - const expires = new Date(); - expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000); - document.cookie = `${name}=${value};expires=${expires.toUTCString()};path=/`; - } - - // 쿠키 가져오기 함수 - function getCookie(name) { - const value = `; ${document.cookie}`; - const parts = value.split(`; ${name}=`); - if (parts.length === 2) return parts.pop().split(';').shift(); - return null; - }