modified to add option to disallow future date, past date, and month and year only