Use validators based on date range
<iframe width="560" height="315" src="https://www.youtube.com/embed/cK2qPE06w_k" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
Use the following script as a workflow transition validator. It allows a transition only if the date field value is within 180 days from today.
interval range = "180d";
date maxDate = currentDate() + range;
string errorMsg = "Due date must be within 180 days of today";
if(isNull(due) || due > maxDate) {
return false, "error", errorMsg;
}