The post that you linked to is the option that allows you to restrict the date ranges with the date picker.
There is no way to prevent a user from selecting specific dates, as far as I’m aware. It might be possible with CSS, but I can’t say for sure.
One option you do have (if using a custom form) is to catch “invalid” dates in real time and show appropriate warning messages - and prevent saving - if they don’t meet specific criteria.
Here is an example of what can be done:
The above example doesn’t stop the user from selecting dates that you don’t want them to. But it does warn them when they do, and prevent them from saving.