title: why date format give true value using momentjs?
body: <p>I am trying to validate formate . but I am getting <strong>true</strong> value .</p>
  <p>why ?</p>
  <pre><code>  var a = &quot;11-01-2022&quot;;
    console.log(&quot;sss&quot;, moment(a, &quot;YYYY-mm-DD&quot;).isValid());
  </code></pre>
  <p>Expected output is : false. here I am getting true why ?</p>
  <pre><code>var a = &quot;2022-01-11&quot;;
        console.log(&quot;sss&quot;, moment(a, &quot;YYYY-mm-DD&quot;).isValid());
  Expected output is : true.
  </code></pre>
  <p>here is my code
  <a href="https://codesandbox.io/s/patient-cookies-npsit?file=/src/App.js:85-165" rel="nofollow noreferrer">https://codesandbox.io/s/patient-cookies-npsit?file=/src/App.js:85-165</a></p>