title: Determining Business Hours Past Midnight in MomentJS
body: <p>I'm using <a href="https://momentjs.com/" rel="nofollow noreferrer">MomentJS</a> in my app to determine whether or not a business is currently open.</p>
  
  <p>I store my the hours in the following format:</p>
  
  <pre><code>{ open_time: "Thu Jan 01 1970 08:00:00 GMT-0500 (Eastern Standard Time)" },
  { close_time: "Thu Jan 01 1970 23:00:00 GMT-0500 (Eastern Standard Time)" }
  </code></pre>
  
  <p>And in my code:</p>
  
  <pre><code>let openTime = moment(weekday.open_time).format('HH:MM'); // 08:00
  let closeTime = moment(weekday.close_time).format('HH:MM'); // 23:00
  let currentTime = moment(new Date()).format('HH:MM'); // 20:00
  
  // Determine if business is currently open
  let isOpenNow = currentTime &gt;= openTime &amp;&amp; currentTime &lt; closeTime ? true : false
  </code></pre>
  
  <p>This works fine unless the <code>close_time</code> of a business is <strong>Midnight</strong> or later, for example:</p>
  
  <pre><code>open_time: 08:00 
  close_time: 02:00 // The next day
  </code></pre>
  
  <p>Is there a simple way to account for this in moment (or some plain jane javascript logic)?</p>