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

Half day documentation #301

Closed ShapesGraphicStudio closed 4 months ago

ShapesGraphicStudio commented 3 years ago

Hello, Could you please put out some documentaion on the half day use? I can read : "Allows to have half a day, if you have check in at noon and checkout before noon" but I can't see how to implement this.

I'm having some issues with disabled dates.

EXAMPLE: I have bookings: from the 15th to the 16th of the month from the 17th to the 21st of the month from the 23rd to the 24th of the month from the 25th to the 26th of the month

So the user should be able to book: from the 16th to the 17th of the month from the 21st to the 23rd of the month from the 24th to the 25th of the month

My disabled dates calculation goes like: $period = CarbonPeriod::create($booking->starts_at, $booking->ends_at); which disables too many dates

If I try something like: $period = CarbonPeriod::create(Carbon::parse($booking->starts_at)->addDay(), Carbon::parse($booking->ends_at)->subDay()); It re-enables all the dates I need but the ranges I can select are too wide, now I can book from the 21st to the 25th.

Given the upper example I shouldn't be able to book: from the 21st to the 25th but only: from the 21st to the 23rd and from the 24th to the 25th

So the only way to solve this should be Half days. Could you document on how to get this done please?

matiasperrone commented 3 years ago

Hi David @ShapesGraphicStudio,

I didn't develop that part of the component, I will check it out so we may set an example. Maybe @krystalcampioni or @superbiche can help us to speed up the process.

Have a nice one!

matiasperrone commented 2 years ago

Hi @ShapesGraphicStudio did you fixed your issue some how? Do you want to share?

ShapesGraphicStudio commented 1 year ago

Hello, I finally got some time to read this all more carefully. The important notice I missed in the documentation (can't remeber if this piece was there last year) was " if you have check in at noon and checkout before noon ".

Now when requesting my disabled dates, the bookings I already have stored, I change the format from Y-m-d to Y-m-d H:i, and I "force" the starting date to be at 15:00 and the ending date at 11:00 for each booking. It seems to work now.

matiasperrone commented 4 months ago

Nice catch.

matiasperrone commented 4 months ago

What version are (or were) you using?