title: How to print all the dates of a month using Javascript AngularJS
body: <p>I want to show all the dates of a given month. Suppose, if I select Oct, 2015, then it should show all the dates of that month in a list. I can print all the dates of next 365 days using setDate(), but how can I print only dates of a selected month. Check this code to show next 365 days.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function Ctrl($scope) {
    $scope.dates = [];
    for (i = 0; i &lt;= 364; i++) {
      var d = new Date();
      $scope.dates.push(d.setDate(d.getDate() + i));
    }
  }</code></pre>
  </div>
  </div>
  </p>