PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Blackout dates

  1. I need to create a tour registration form that will allow visitors to schedule a campus tour M-F from 9-4, except on dates when the school will be closed. To this end, I need the date selector to allow me to blackout weekends and the occasional holiday as unavailable for selection. Any chance this can ever be possible?

    Posted 14 years ago on Tuesday December 1, 2009 | Permalink
  2. Shelly,

    We've discussed some more advanced date/scheduling options like date range, blackout dates, etc. so they're on the drawing board. I'm not sure how soon they'll make a release or add-on though.

    Posted 14 years ago on Tuesday December 1, 2009 | Permalink
  3. The datepicker script that we currently use (jQuery UI) does allow us to select some dates as unavailable, so graying out dates in the calendar won't be possible. From what I can see, there are two possible ways to handle this (none of them are great).

    1- You could write javascript code to validate that the date is valid when the user selects a date from the calendar. So the user would be able to select a date, but you would then validate and display an error message if the dates are invalid.
    The problem with this approach is that the only way to do this is to change the datepicker.js file and that will make your upgrades a bit more painful. You will have to remember to save that file and copy it over the new one after the upgrade.

    2- The other option is to validate the date during the form submission process. You will have to write PHP code to do the validation.
    I think this might be your best option as it doesn't involve changing any of the core files. The only problem is that I will have to add a hook for validation. I don't have a problem doing that, but you will have to wait for the next release.

    Let me know if these seem like valid solutions for you. I can help you with the code part if you need.

    Posted 14 years ago on Tuesday December 1, 2009 | Permalink
  4. Alex,

    Thanks, but having the form validate available dates for tours AFTER the user hits submit isn't particularly friendly. It'd annoy the hell out of me, that's for sure.

    It's ok, this is outside the expected capability of a form manager anyway. I've been researching other options (there aren't many) and thought I'd ask. I'll find a solution.

    Posted 14 years ago on Wednesday December 2, 2009 | Permalink
  5. I agree with you Shelley. That wouldn't be very user friendly. Unfortunately we are bound by the limitation of the jQuery UI datepicker. Not much we can do there.

    Good luck!

    Posted 14 years ago on Wednesday December 2, 2009 | Permalink
  6. I thought I'd check to see if this issue had any movement. I wasn't sure if the newest update might possibly provide something closer to a solution. In English, just checking. Any new thoughts?

    Posted 12 years ago on Tuesday November 1, 2011 | Permalink
  7. Hello Shelley,
    I was browsing through the jQuery UI Datepicker documentation, and unfortunately they still don't support the functionality you are looking for. They have added a minDate and maxDate parameter that you can use to specify a valid range of dates, but you wouldn't be able to exclude weekends and holidays.
    Sorry for the bad news.

    Posted 12 years ago on Wednesday November 9, 2011 | Permalink
  8. @Kevin Any movement on adding advanced date/scheduling options like date range, blackout dates?

    Posted 12 years ago on Wednesday February 22, 2012 | Permalink