function now () { // 현재 날짜, 시간, 분, 초를 모두 가지고 와서 '년-월-일-시-분-초' 형식으로 만들어주는 함수
const popDt = new Date(),
popYear = popDt.getFullYear(),
popMonth = popDt.getMonth() + 1,
popDate = popDt.getDate(),
popHours = popDt.getHours(),
popMin = popDt.getMinutes(),
popSecond = popDt.getSeconds();
return popYear+'-'+(popMonth<10?'0'+popMonth:popMonth)+'-'+(popDate<10?'0'+popDate:popDate)+'-'+popHours+'-'+popMin+'-'+popSecond;
};
function endDate() { // 끝나는 날짜, 시간, 분, 초를 모두 가지고 와서 '년-월-일-시-분-초' 형식으로 만들어주는 함수
const endYear = "2021",
endMonth = "11",
endDate = "12",
endHours = "11",
endMin = "33",
endSecond = "00";
return endYear+'-'+(endMonth<10?'0'+endMonth:endMonth)+'-'+(endDate<10?'0'+endDate:endDate)+'-'+endHours+'-'+endMin+'-'+endSecond;
};
function dayNone() { // 현재 날짜와, 끝나는 날짜 서로 비교하여 pop을 숨기는 기능
if(now() > endDate()){
pop.style.display = 'none';
}
};