title: Yup.date() convert date into string without timezone after validation
body: <p>I using Yup with react-hook-form and have the following schema in Yup</p>
  <pre><code>  const validationSchema = Yup.object({
      installation: Yup.string().nullable().required(&quot;Required&quot;),
      from_date: Yup.date()
        .max(new Date(), &quot;Cannot use future date&quot;)
        .nullable()
        .required(&quot;Required&quot;),
      to_date: Yup.date()
        .min(Yup.ref(&quot;from_date&quot;), &quot;To Date cannot be before From Date&quot;)
        .max(new Date(), &quot;Cannot use future date&quot;)
        .nullable()
        .required(&quot;Required&quot;)
    });
  
  </code></pre>
  <p>When I type the date in the inputs, the validation is working perfectly but the date is being returned in the format <code>2021-03-31T18:30:00.000Z</code>, however I want the date to be returned just as <code>2021-03-31</code>.</p>
  <p>I am sending the data to a Django backend server and that expects just a DateField without the timezone. How should I do this?</p>
  <p>Is there any way to convert the date without the timezone. I can get it working if I use <code>Yup.string()</code> instead, but then the necessary validation would not work.</p>
  <p><strong>Possible Solution Idea (But need help to understand how to do it)</strong></p>
  <p>Can I write some custom validation in Yup. If that is possible then i could use <code>Yup.string()</code> and still perform the necessary validation</p>
  <ol>
  <li>Use <code>Yup.string()</code></li>
  <li>Convert to date</li>
  <li>Perform the necessary validation</li>
  <li>Reconvert date to string</li>
  <li>And return string</li>
  </ol>
  <p>P.S This question has had many views but no significant comments or answers. Can I change the question formatting to make it more understandable?</p>