My client want to limit the bookings for Sundays only. As per my client's requirement, I have modified the code and produced a feature. Its not complete in a generic point of view.

With the attached patch, it only allows to select a particular day of the week, or all days.

CommentFileSizeAuthor
available_calendars.20120630.patch7.16 KBkevinsiji
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fietserwin’s picture

Version: 7.x-2.4 » 7.x-3.x-dev
Status: Needs review » Postponed

We have quite some requests to restrict bookings one way or another, including:
- minimal period (e.g. 1 week)
- fixed start day (e.g. Saturday is changeover day)
- minimum number of days
- only allow for some days of the week (yours)
- different default state per day of the week (e.g. #1528068: Per-day default status

The problem is that I have no clear idea how to implement that in a generic way. I guess that a time slot booking module (with a calendar display, easy and flexible time slot generation, and time-slot contention handling) would be better suited to a situation with booking restrictions.

Postponing for now. So this won't be incorporated into the next version.

If you want to be able to update your version, you better try to place your changes to the code in a custom module. It looks like the form changes can be done in a hook_form_FORM_ID_alter and your theme changes in a theme preprocess. (But I had a quick look only.) The js changes actually relate to a more or less separate feature (for the booking fomlet sub-module): "support single day rental use case". That feature, if made a selection somewhere in the settings, is a good candidate for inclusion in the next version and could be combined with #1661454: Better distinction between whole day and overnight rental.

Note that a combination of #1528068: Per-day default status and the single day rental feature could cover your use case as well. But the other issue is postponed as well.

fietserwin’s picture

Created #1668242: Make the UI for single day rental use cases easier as a spin off for the single day rental use case.

fietserwin’s picture

Version: 7.x-3.x-dev » 7.x-4.x-dev
fietserwin’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

I am currently going through the issue queue and am closing old issues that have not had any response since long. Closing this one as out of scope.