문제 발생) $(".reservationdate").each(function() {} 가 실행되지 않음
function displayCalendar(date, schedules) {}
const gamelist = []; // game Date형 배열
const gameMinuslist = []; // game5일전 Date형 배열
for(let i = 0; i < gameDates.length; i++){
const [monthStr, dayStr] = gameDates[i].split('.');
const month = parseInt(monthStr, 10);
const day = parseInt(dayStr, 10);
const gamelistDate = new Date(currentDate.getFullYear(), month - 1, day);
gamelist.push(gamelistDate);
//console.log("!!!" + gamelist[35]);
const gameMinusDate = new Date(currentDate.getFullYear(), gamelistDate.getMonth(), (gamelistDate.getDate()-4));
gameMinuslist.push(gameMinusDate);
//console.log("@@@" + gameMinuslist[35]);
}
$(".reservationdate").each(
function() {
// 클래스이름을 조회해서 split
var classes = $(this).attr("class").split(" ");
const thisdate = classes[1];
const [yearStr, monthStr, dayStr] = thisdate.split('-');
const year = parseInt(yearStr, 10); //parseInt(string, radix(진수)) 문자열 분석하고 정수로 변환
const month = parseInt(monthStr, 10);
const day = parseInt(dayStr, 10);
const thisday = new Date(year, month - 1, day); // 현재 날짜 Data
// console.log("thisday: " + thisday);
/* if (isGameToday(thisday, allDatesOfMonth, gameDates) === thisday) {
console.log("thisday: " + thisday);
*/
for(let i = 0; i <= gamelist.length; i++){
if(thisday <= gamelist[i] && thisday >= gameMinuslist[i]){
console.log("gamelist[i]: " + gamelist[i]);
console.log("gameMinuslist[i]: " + gameMinuslist[i]);
$(this).css("background-color", "pink");
}
}
/* } */
});
}

