title: Comparing time with MomentJS
body: <p>I'm trying to compare a time with momentJS. Here is My script</p>
  
  <pre><code>$( document ).ready(function() {
  var today =moment();
  console.log(today.format("hh:mm"));
      if((today.format('D') == (moment().day("Sunday").format('D')) || (today.format('D') == moment().day('Saturday').format('D'))))
          {
              $('.kompensasi').val("100,000");
              $('.chk').hide();
          }
      else{       
          if((today.format("hh:mm") &gt; moment('00:00', 'hh:mm')) &amp;&amp; (today.format("hh:mm") &lt; moment('03:00', 'hh:mm')))
                  {
                      $('.kompensasi').val("30,000");
                      $('.cekbok').val('');
                  }else{
                      $('.cekbok').val('Dapet RO 1');
                      $('.kompensasi').val("0");
                  }
          }
  });
  </code></pre>
  
  <p>and here is my form </p>
  
  <pre><code>&lt;div class="col-sm-7"&gt;
  
  
  
              Kompensasi : &lt;input name="dapet" type="text" readonly class="kompensasi" /&gt;
             &lt;/div&gt;  
      &lt;/div&gt;
               &lt;div class="form-group chk"&gt;
                        &lt;label class="col-sm-3 control-label"&gt;Ro&lt;/label&gt;
                        &lt;div class="col-sm-7"&gt;
                        &lt;input type="text" class='cekbok' name='rostatus' /&gt;
                        &lt;/div&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>from <code>console.log(today.format("hh:mm"))</code> i get this resullt <code>01:44</code>. </p>
  
  <p>With my script above i always go to the <code>else</code>, so is there any way to fix it ?</p>
  
  <p>Here is my fiddle <a href="https://jsfiddle.net/s9wfh9ye/33/" rel="noreferrer">https://jsfiddle.net/s9wfh9ye/33/</a></p>
  
  <p>My Upated Question </p>
  
  <pre><code>    var today =moment();
      var after  = moment(today.format("hh:mm")).isAfter(moment('00:00', "hh:mm"));
      var before = moment(today.format("hh:mm")).isBefore(moment('03:00', "hh:mm"));
  
          today.format('hh:mm').valueOf() --&gt;02:17
  
          moment('00:00', 'hh:mm').valueOf() --&gt; 1472058000000
  
          moment('03:00', 'hh:mm').valueOf() --&gt;1472068800000
  
  
  
     console.log(after); // false
  
  console.log(before); // false
  </code></pre>