SHARE
TWEET

gifted

a guest Dec 16th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getTheDay(date) {
  2.             var day = date.getDay();
  3.             if(day == 0){
  4.                 day = "Sunday";
  5.             }else if(day == 1){
  6.                 day = "Monday";
  7.             }else if(day == 2){
  8.                 day = "Tuesday";
  9.             }else if(day == 3){
  10.                 day = "Wednesday";
  11.             }else if(day == 4){
  12.                 day = "Thursday";
  13.             }else if(day == 5){
  14.                 day = "Friday";
  15.             }else {
  16.                 day = "Saturday";
  17.             }
  18.             $.each(dates, function(i, p) {
  19.                 console.log(p.dayOfWeek);
  20.                 var arrDay =  p.dayOfWeek;
  21.                 if (day === arrDay){
  22.                     console.log(day + " & " + arrDay);
  23.                     let startTime = new Date(0,0,0, p.startTime,0,0).toLocaleTimeString();
  24.                     let j = new Date(0,0,0, p.endTime, 0, 0).toLocaleTimeString();
  25.                     console.log(startTime +"    " +j);
  26.                     // for( i = startTime, i < j; i++){
  27.                     //     console.log(i);
  28.                     // }
  29.                 }
  30.             });
  31.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top