added some validation for the datetime input fields