northwalker / vue-hotel-datepicker

A Vue.js date range picker component without other dependencies for hotels and multi-purpose.
https://northwalker.github.io/vue-hotel-datepicker/
MIT License
85 stars 27 forks source link

previous arrow not visible if minDate from previous month but startDate not specified #2

Closed shouryaps closed 5 years ago

shouryaps commented 5 years ago

Hi! Thank you so much for this component! 😄 I was trying this component out, and I found that if we specify a previous month minDate and some future maxDate as props, the previous month arrow is not visible to navigate to a previous date. However, if we specify minDate, maxDate, startDate as well as endDate making sure that the startDate lies in a previous month, then only the previous month arrow is visible. It will create an issue for users to select a previous month start date in cases where there is no default date range initialized.

So I checked the code and it seems, there is a function called disabledPreviousArrow that decides whether 'disabled' class is to be added for the previous-arrow. The decision there takes place based on startDate, but I guess it should also depend on minDate. In cases where startDate is not specified but a minDate from a previous month is specified, 'disabled' class should not be added.

northwalker commented 5 years ago

It's should be fixed at 2.0.2.

minDate has a default value today, but if user preset a startDate and less than minDate (or no minDate), minDate will be set to equal to startDate, and that will fixed previous-arrow displaying bug and others.

Thank you for your reporting. :)