Advertisement
VladislavNechepaev

Untitled

Dec 28th, 2021
1,256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const holidaysManual = [
  2.         "2022-01-03",
  3.         "2022-01-07"
  4.       ]
  5.  
  6. // ======================================
  7.  
  8. fetch("https://freshservicecounter.ringteam.com/getholidays").then(res => {
  9.         return res.json()
  10.       }).then(holidays => {
  11.         const holidaysAll = holidays.concat(holidaysManual)
  12.         console.log(holidaysAll)
  13.         dateList.forEach(dateElem => {
  14.           jQuery(dateElem).datepicker("option", {
  15.             beforeShowDay: function(dateRaw) {
  16.               dateRaw.setHours(dateRaw.getHours() + 3)
  17.               const dateIso = dateRaw.toISOString().split("T")[0]
  18.               return [!holidaysAll.includes(dateIso), ""]
  19.             }
  20.           })
  21.         })
  22.       })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement