Merge branch 'susu' into dev
This commit is contained in:
@@ -819,15 +819,16 @@
|
|||||||
|
|
||||||
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const lastDayOfMonth = new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 0); // 해당 달의 마지막 날
|
//const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0); // 해당 달의 마지막 날
|
||||||
// 쿠키에서 마지막 alert 날짜 확인
|
const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth(), 21); // TODO 삭제 테스트를 위해 22일로 수정
|
||||||
const lastAlertDate = getCookie('lastAlertDate');
|
// 마지막 alert 날짜 확인
|
||||||
const todayDateString = today.toISOString().split('T')[0];
|
const lastAlertDate = sessionStorage.getItem('lastAlertDate');
|
||||||
|
const todayDateString = today.toDateString();
|
||||||
|
|
||||||
if (lastAlertDate !== todayDateString &&
|
if (lastAlertDate !== todayDateString &&
|
||||||
today.getFullYear() === lastDayOfMonth.getFullYear() &&
|
today.getFullYear() === lastDayOfMonth.getFullYear() &&
|
||||||
today.getMonth() === lastDayOfMonth.getMonth() &&
|
today.getMonth() === lastDayOfMonth.getMonth() &&
|
||||||
today.getDate() === lastDayOfMonth.getDate()) {
|
today.getDate() === lastDayOfMonth.getDate()) {
|
||||||
|
|
||||||
ajaxUtil._ajaxSyncMethod(
|
ajaxUtil._ajaxSyncMethod(
|
||||||
ENV.httpUrl.alert.replace('{searchMonth}', searchMonth.replace('-', '')),
|
ENV.httpUrl.alert.replace('{searchMonth}', searchMonth.replace('-', '')),
|
||||||
{},
|
{},
|
||||||
@@ -862,6 +863,7 @@
|
|||||||
message: msgTxt,
|
message: msgTxt,
|
||||||
type:'alert',
|
type:'alert',
|
||||||
callback: function () {
|
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;
|
|
||||||
}
|
|
||||||
</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