Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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), ""]
- }
- })
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement