title: JavaScript - List of last 12 Months
body: <p>I have an Angualr service that lists out 12 months and year from the current month:</p>
  
  <p>JS:</p>
  
  <pre><code>app.factory('12months', function() {
      return {
          getMonths: function() {
              var date = new Date();
              var months = [],
                  monthNames = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
              for(var i = 0; i &lt; 12; i++) {
                  months.push(monthNames[date.getMonth()] + ' ' + date.getFullYear());
                  date.setMonth(date.getMonth() - 1);
              }    
              return months;
          }
       };
   });
  </code></pre>
  
  <p>Which output is:</p>
  
  <pre><code>Oct 2014, Sep 2014, Aug 2014 etc etc
  </code></pre>
  
  <p>How can i modify this to display the day too, so:</p>
  
  <pre><code>21 Oct 2014, 21 Sep 2014, 21 Aug 2014 etc etc
  </code></pre>