longbill / jquery-date-range-picker

A jQuery plugin that allows user to select a date range
MIT License
1.12k stars 578 forks source link

Is there a way to disable dates for checkin / checkout only? #303

Open davleh opened 7 years ago

davleh commented 7 years ago

Usage: Hotel Booking

Is there a way to disable dates for checkin / checkout only, so that these days can’t be selected as start or end date, however booking / selecting a period over these days / containing these days should be possible.

holtkamp commented 7 years ago

Mm, you can have a look at the beforeShowDay function. Not sure how that affects the ability to select such dates as "in between" dates...

davleh commented 7 years ago

Thanks @holtkamp for your quick reply!

Unfortunately if this method returns valid = false, selecting periods over/through the specified day is not possible any more.

A good thing would be to offer 3 options here: disabling as start date, disabling as end date and disabling for selecting through.

Perhaps there is already an option offering that functionality and I just did not find it. In this case I would be very happy if someone could point me at it. ;)

DeveloperWilco commented 6 years ago

@davleh Looking for the same functionality. Did you find anything?

I also need to be able to select a range of days around the disabled days.

davleh commented 6 years ago

@DeveloperWilco: Unfortunately I was not able to find any option to achieve this. I tried to implement this functionality into this datepicker to create a pull request later on, but gave up.

DeveloperWilco commented 6 years ago

@davleh: Then i'm doing the same. I'll just validate it with PHP right after. Thanks for your quick reply

dev-overnode commented 5 years ago

It seems to be an error from function isValidTime (Line 1 575) Removing lines from 1 594 to 1 598 fix my problem. (Or change valid = false; to valid = true; on line 1 596

carlosnasillo commented 1 year ago

looking for the same, did anyone find a proper way to achieve this? 🙏