일계부 말일 alert 창 한번만
This commit is contained in:
@@ -809,11 +809,14 @@
|
|||||||
|
|
||||||
$('#selectedDay').html(html);
|
$('#selectedDay').html(html);
|
||||||
|
|
||||||
|
|
||||||
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const lastDayOfMonth = new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 0); // 해당 달의 마지막 날
|
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.getMonth() === lastDayOfMonth.getMonth() &&
|
||||||
today.getDate() === lastDayOfMonth.getDate()) {
|
today.getDate() === lastDayOfMonth.getDate()) {
|
||||||
ajaxUtil._ajaxSyncMethod(
|
ajaxUtil._ajaxSyncMethod(
|
||||||
@@ -868,6 +871,21 @@
|
|||||||
location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth.replace('-', '')).replace('{groupNo}', groupNo);
|
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>
|
||||||
<script id="dailyNoneTmpl" type="text/x-jsrender">
|
<script id="dailyNoneTmpl" type="text/x-jsrender">
|
||||||
{{include tmpl="#titleTmpl" /}}
|
{{include tmpl="#titleTmpl" /}}
|
||||||
|
|||||||
Reference in New Issue
Block a user