const schema = Yup.date() .nullable() .transform((curr, orig) => orig === '' ? null : curr) .required('Mandatory field message')