title: How to validate one field against another with Yup?
body: <p>I'm setting up a form with two fields; start month and end month. </p>
  
  <p>Start month and end month are just represented by integers (0-11) for the corresponding months. I need validation to ensure that end month comes after start month (ie the integer for end month is bigger).</p>
  
  <p>I've looked at other similar issues from a few years back, but yup seems to have updated to render them useless. I've tried the below code with a few variations.</p>
  
  <p>I am also having difficulty validating end month as a number (<code>.number()</code> - I'm assuming I have to maybe to do this within the test function.</p>
  
  <pre><code>let schema = yup.object().shape({
    startMonth: yup
      .number()
      .required()
      .positive()
      .integer(),
    endMonth: Yup.string().test(
    "End Month Validation",
    "error message",
    value =&gt; {
      return value &gt; startMonth;
    }
  )
  .number()
  .required()
  .positive()
  .integer(),
  });
  </code></pre>
  
  <blockquote>
    <p>Errors:
    Line 102:  'startMonth' is not defined  no-undef</p>
  </blockquote>