I want user to restrict some dates based on another input.
look over this answers, as i think it might help you with the first portion.
https://answers.splunk.com/answers/222650/limit-choices-in-default-timepicker.html
What do you need to do with the custom error message?