title: function to Get whole month dates based on day name
body: <p>I am trying to disable all the dates in a month based on user selected day
  eg: if user selects monday, i need to disable all monday.</p>
  <p>so i have this function which takes 3 arguments(month, year and array of disabled day). Looks its working until i have disabled array with</p>
  <pre><code>  [
      &quot;Monday&quot;,
      &quot;Tuesday&quot;,
      &quot;Wednesday&quot;,
      &quot;Thursday&quot;,
      &quot;Friday&quot;,
      &quot;Saturday&quot;,
    ]
  </code></pre>
  <p>eg: i have this argument month is  3,
  year is 2021, and days as above array.</p>
  <pre><code>    const getDaysInMonth = (month, year, days) =&gt; {
  
  
      let pivot = moment().month(month).year(year).startOf(&quot;month&quot;);
      const end = moment().month(month).year(year).endOf(&quot;month&quot;);
  
      let dates = {};
      const disabled = { disabled: true, disableTouchEvent: true };
      while (moment(pivot).isBefore(end)) {
        days.forEach((day) =&gt; {
          dates[pivot.day(day).format(&quot;YYYY-MM-DD&quot;)] = disabled;
        });
        pivot.add(7, &quot;days&quot;);
      }
  
      console.log(&quot;before return is&quot;, dates);
  
      return dates;
    };
  </code></pre>
  <p>with this function i am not getting dates after &quot;24th saturday&quot; that is last week dates are missing.</p>