title: get an array of dates from today for datepicker with Javascript
body: <p>I am trying to write a function that returns an array of dates from today till the maximum date, so that I can restrict the date picker selection.  At the moment I have the following:-</p>
  
  <pre><code>   datesAfterToday: function (date) {
      var dates = []
      var currentDate = new Date()
      var endDate = new Date(8640000000000000).getFullYear()
      var addDays = function (days) {
        var date = new Date(this.valueOf())
        date.setDate(date.getDate() + days)
        return date
      }
      while (currentDate &lt;= endDate) {
        dates.push(currentDate)
        currentDate = addDays.call(currentDate, 1)
      }
      return dates
    }
  </code></pre>
  
  <p>and then I am using Vue.js to mount it as follows :-</p>
  
  <pre><code> mounted () {
     this.allowedDates = this.datesAfterToday
   },
  </code></pre>
  
  <p>however I am only getting an array of objects instead of the proper array.</p>
  
  <p>How can I get the proper array of dates so that I can bind it to the allowdates property.</p>
  
  <p>Thanks for your help and time!</p>