ZestfulNation / vue-hotel-datepicker

A VueJS v2 responsive date range picker. Displays the number of nights selected and allow several useful options like custom check-in/check-out rules, localization support and more.
https://zestfulnation.github.io/vue-hotel-datepicker/
MIT License
840 stars 220 forks source link

Add new Events & Fixes Related to Single Month View #298

Closed maaqib121 closed 3 years ago

maaqib121 commented 3 years ago

277

Issues in single month view: 1) Let's suppose today is September 6, 2021. If we pass :singleMonth="true" and endDate="2021-11-15", it will stop paginating at October and will not allow us to go to November which is basically the month of endDate.

2) Create two months in generateInitialMonths() method even if we pass :singleMonth="true". The disadvantage of this is when we are in singleMonth view and the current month is September, the next-month-rendered with send November as its argument instead of October.

Fixes 1) In case of :singleMonth="true", the pagination will now stop at the month of end date rather than a month before the month of end date, while the existing behavior for double months will remain the same

2) In case of :singleMonth="true", generateInitialMonths() method will create one month, while the default behavior for double months will remain the same.

Events Added 1) 'previous-month-rendered' event will emit whenever user will click on previous month. 2) 'check-in-selected' event will emit whenever user will click on check in date irrespective of whether it is the consecutive click on the same checkin date or not. ('check-in-changed' event does not trigger when selects the same check in date consecutively).

matiasperrone commented 3 years ago

@maaqib121 did you tested the "normal" functionality, let say all the other configuration that does not have this issue?

maaqib121 commented 3 years ago

@matiasperrone Yes, I have tested the normal functionality before each commit and then tested as a whole before making the PR.

matiasperrone commented 3 years ago

Can you upload the docs (readme.md) for the new events?... so I can publish the new version?

maaqib121 commented 3 years ago

Can you upload the docs (readme.md) for the new events?... so I can publish the new version?

Sure, I'll update it