Advertisement
VladislavNechepaev

Untitled

Jun 7th, 2021
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var hasMeidoId = false
  2.  
  3. // ================================
  4.  
  5. const userId = "{{current_user.id}}"
  6. fetch(`https://freshservicecounter.ringteam.com/getmeidologin?id=${userId}&test=true`).then(res => {
  7.   console.log(res.status)
  8.   if (res.status === 200) hasMeidoId = true
  9. })
  10.  
  11. // ================================
  12.  
  13. var weekendOnly = true
  14. datesInRequest.forEach(date => {
  15.   var weekday = new Date(date).getDay()
  16.   if (weekday !== 6 && weekday !== 0) weekendOnly = false
  17. })
  18.            
  19. if (durationList[values.duration] && officeList[values.office] && accessWeek[values.access_week] && datesInRequest.length && !(datesInRequest.length === 1 && datesInRequest[0] === today) && !accessWeekChanged && !weekendOnly) {
  20.  
  21. // ================================
  22.  
  23. if (weekdayGlobal === 6 || weekdayGlobal === 0 || (weekdayGlobal === 5 && currentHoursGlobal >= 19 && currentMinutesGlobal >= 30) || values.access_week === "Current week" || !officeMeido[values.office] || !hasMeidoId) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement