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

Exact Nights Value to perform Calculations. #191

Closed cjlaborde closed 4 years ago

cjlaborde commented 4 years ago

I would like to extract nights to perform calculations. price * Number of Nights = Total Cost.

Displaying nights is Great but would be better if we could extract it to perform preview of the total cost.

Or is this already possible?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

matiasperrone commented 4 years ago

This is a Feature Request. I don't think I'll be implementing this, but I will if you can provide a PR. What do you think?

cjlaborde commented 4 years ago

I already resolved it weeks ago with

       getNights() {
              return moment(this.end_date).diff(moment(this.start_date), 'days');
            },
matiasperrone commented 4 years ago

There is a PR?