MikaelEdebro / vue-airbnb-style-datepicker

A VueJs datepicker with a similar look and functionality as the popular AirBnb datepicker.
https://mikaeledebro.gitbooks.io/vue-airbnb-style-datepicker/
MIT License
505 stars 105 forks source link

Disable all dates with an empty array for enabledDates #143

Open diakonovm opened 4 years ago

diakonovm commented 4 years ago

If I pass an empty array to the enabledDates prop, the expected behavior would be that all dates are disabled. Yet, an empty array doesn't disable any dates.

isDateDisabled(date) {
  if (this.enabledDates.length > 0) {
    return this.enabledDates.indexOf(date) === -1
  } else {
    return this.disabledDates.indexOf(date) > -1
  }
}

The functionality of the above method needs to be reconsidered.