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

When min-date is set to past date, the calendar should default to the month of min-date #83

Open ruchitabavishi opened 5 years ago

ruchitabavishi commented 5 years ago

I have hardcoded the min-date = "2018-11-11" and end-date = "2018-12-12" So when we open the calendar it should show nov-2018 month by default, but it always shows the current month.

also, this is working good with the future dates, if we set min-date and end-date to future dates, suppose-min-date = "2019-02-02" and end-date="2019-03-03" and we open the calendar, it will by default open the Feb-2019 month.

please help on this to resolve.

Thanks

daamsie commented 5 years ago

Just bumped into this problem as well. I don't agree that the calendar should default to min-date though.

For example you might have a date picker where people have to enter their date of birth and let's say you set the min-date to 2000 because you don't want anyone over the age of 19 registering. That doesn't mean that you want the default date to be 2000. You might want to set it to where you expect most dates to fall.

What we probably need is something more like a default-date prop that allows us to set where the calendar focuses.

bnd170 commented 5 years ago

default-date prop is a good idea for cases like the date of birth calendar, for our users would be more comfortable if the calendar shows a month that match with our max-date. At the moment the calendar shows the current date and if we want to let register people with +18 ages they must back 18 years at least to select the right date.