validate the date