title: Display next 5 days excluding Sundays in javascript
body: <p>I am displaying the following code for next 5 days </p>
  
  <pre><code>function setDateTime() {
      var timesOffice = (officeTimes[officeID] + "").split(",");
      //alert(officeTimes[officeID]+":12:"+timesOffice[0]);
      var dt = new Date(correctDate);
      var dateOptions = "";
      var firstdateString = "";
      var totalDays = 5;
      for (i = 0; i &lt; totalDays; i++) {
  
          var sateString = dt.getFullYear() + " " + monthNames[dt.getMonth()] + " " + (dt.getDate());
          //console.log("i:"+i+"s:"+sateString);
          dateFlag = 0;
          var j = 0;
          for (j = 0; j &lt; timesOffice.length; j++) {
  
              if (checkValidDateTime(sateString, timesOffice[j])) {
                  dateFlag = 1;
                  break;
              }
          }
          dt.setDate(dt.getDate() + 1);
          if (dateFlag == 0) {
              totalDays++;
              continue;
          }
          if (firstdateString == "") firstdateString = sateString;
          dateOptions = dateOptions + '&lt;option value="' + sateString + '"&gt;' + sateString + '&lt;/option&gt;';
  
  
      }
      $(".date").html(dateOptions);
  }
  </code></pre>
  
  <p>I want to exclude Sundays from this list </p>