title: convert iso time strings to valid momentjs format and compare them
body: <p>I want to compare some times with <a href="https://www.npmjs.com/package/moment" rel="nofollow noreferrer">momentjs</a>. These times come from time pickers and use the ISO 8601 format, 24hr hh:mm (more info <a href="https://vuetifyjs.com/en/components/time-pickers" rel="nofollow noreferrer">here</a>).</p>
  
  <p>I want to compare the examples "01:45" and "13:36". Using the function <code>isSameOrBefore</code> should return me <code>true</code>. Unfortunately</p>
  
  <pre><code>const valid = moment("01:45").isSameOrBefore("13:36")
  </code></pre>
  
  <p>does not work, because the iso strings use a wrong format. I get the warning </p>
  
  <blockquote>
    <p>Deprecation warning: value provided is not in a recognized RFC2822 or
    ISO format. moment construction falls back to js Date()</p>
  </blockquote>
  
  <p>I tried to go for this</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const isoFormat = 'hh:mm'
  
  const first = "01:45"
  const second = "13:36"
  
  const firstBeforeSecond = moment(first, isoFormat).isBefore(second, isoFormat)
  
  console.log(firstBeforeSecond)</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>but this still fails. The value I get returned is <code>false</code> and this is not correct. What is the correct way to compare these time strings?</p>