일계부 말일 alert 창 한번만

This commit is contained in:
주수현
2025-07-11 08:46:29 +09:00
parent f8d8b606b1
commit d1d8de6db9

View File

@@ -809,11 +809,14 @@
$('#selectedDay').html(html);
// 오늘 날짜가 해당 달의 마지막 날인지 확인
const today = new Date();
const lastDayOfMonth = new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 0); // 해당 달의 마지막 날
if (today.getFullYear() === lastDayOfMonth.getFullYear() &&
// 쿠키에서 마지막 alert 날짜 확인
const lastAlertDate = getCookie('lastAlertDate');
const todayDateString = today.toISOString().split('T')[0];
if (lastAlertDate !== todayDateString &&
today.getFullYear() === lastDayOfMonth.getFullYear() &&
today.getMonth() === lastDayOfMonth.getMonth() &&
today.getDate() === lastDayOfMonth.getDate()) {
ajaxUtil._ajaxSyncMethod(
@@ -868,6 +871,21 @@
location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth.replace('-', '')).replace('{groupNo}', groupNo);
},
};
// 쿠키 설정 함수
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;
}
</script>
<script id="dailyNoneTmpl" type="text/x-jsrender">
{{include tmpl="#titleTmpl" /}}