/* function isGameToday(currentDate, allDatesOfMonth, gameDates) {
for (let i = 0; i < gameDates.length; i++) {
const formattedCurrentDate = getFormattedDate(allDatesOfMonth[i]);
if (gameDates.includes(formattedCurrentDate)) {
return formattedCurrentDate;
}
}
} */실패작
function isGameToday(currentDate, allDatesOfMonth, gameDates) {
const formattedCurrentDate = getFormattedDate(currentDate);
return gameDates.includes(formattedCurrentDate);
}
function openModal(id) {
var zIndex = 999;
const modal = document.getElementById(id);
const selectedDateElement = document.getElementById("modal-content");
var bg = document.createElement('div');
bg.className = 'modal_bg';
bg.setStyle({
position: 'fixed',
zIndex: zIndex,
left: '0px',
top: '0px',
width: '100%',
height: '100%',
overflow: 'auto',
backgroundColor: 'rgba(0,0,0,0.3)'
});
document.body.append(bg);
modal.querySelector('.modal_close_btn').addEventListener('click', function() {
bg.remove();
modal.style.display = 'none';
});
modal.setStyle({
position: 'fixed',
display: 'block',
boxShadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)',
zIndex: 10000,
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
msTransform: 'translate(-50%, -50%)',
webkitTransform: 'translate(-50%, -50%)'
});
}
- 아 나 바보인가 const modal = document.getElementById(id); 이거 파라미터 이상하게 넘겨줘서 모달이 안나온거였자나...?;;