title: Create array of dates and minutes with JavaScript
body: <p>How can I create an array of dates with format <code>DD-MM-YYYY</code> from today and 1 ahead?</p>
  
  <p>I guess it's something like</p>
  
  <pre><code>var dates = [];
  var date = moment();
  
  while (date &lt;= date.clone().add(1, 'month')) {
    dates.push(date.format('DD-MM-YYYY'));
    date = date.clone().add(1, 'd');
  }
  </code></pre>
  
  <p>but is this the best way to do it?</p>
  
  <p>And how can I do the same with minutes? I want an array with <code>['00:00', '00:05', '00:10', ..., '23:50', '23:55']</code>.</p>
  
  <p>I guess it's something like</p>
  
  <pre><code>var minutes = [];
  var time = moment('00:00', 'hh:mm');
  
  while (time &lt; time.clone().add(1, 'day')) {
    minutes.push(time.format('hh:mm'));
    time = time.clone().add(5, 'minutes');
  }
  </code></pre>
  
  <p>It's not important to use moment.js for this, but I guess it's easier.</p>