title: compare validation between two (hh:mm:ss a) times in moment.js
body: <p>I have two times with <code>hh:mm:ss a</code> format.</p>
  
  <p>like </p>
  
  <pre><code>var StartTime="11:50:33 AM";
  var EndTime= "10:50:33 AM;
  </code></pre>
  
  <p>I want the validation for <code>EndTime &gt; StartTime</code>. </p>
  
  <p>i need compare the two times. </p>
  
  <p>If <code>StartTime</code> is greater than <code>EndTime</code>, then i want to show a error message</p>
  
  <p>If <code>EndTime</code> is greater than <code>StartTime</code>, then i want to run next code.</p>
  
  <p>I have tried this below code</p>
  
  <pre><code>var t1 = moment($scope.StartTime, "hh:mm:ss a");
              var t2 = moment($scope.EndTime, "hh:mm:ss a");
              var t3 = moment(t2.diff(t1)).format("hh:mm:ss");
  </code></pre>
  
  <p>But this make does not well. </p>