If I understand your question correctly then I reckon simply check the date. If the user enters date x and date x is within the rules then change it to y. No?

If x = ruledate then x = y --> Then do your magic.

Not very sure how you will determine what date needs to change as it is not stated here.