const holidaysManual = [ "2022-01-03", "2022-01-07" ] // ====================================== fetch("https://freshservicecounter.ringteam.com/getholidays").then(res => { return res.json() }).then(holidays => { const holidaysAll = holidays.concat(holidaysManual) console.log(holidaysAll) dateList.forEach(dateElem => { jQuery(dateElem).datepicker("option", { beforeShowDay: function(dateRaw) { dateRaw.setHours(dateRaw.getHours() + 3) const dateIso = dateRaw.toISOString().split("T")[0] return [!holidaysAll.includes(dateIso), ""] } }) }) })