Added (overeager) client-side validation function for dates