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 15 years ago on Tuesday December 1, 2009 |
Permalink