title: Comparing 2 dates to see if the current date is passed - React/Momentjs
body: <p>I'm currently tying to compare 2 dates (and time): the date limit my action has to be completed and the current date.</p>
  
  <p>I receive the date and time in this format: <code>2017-05-29T15:30:17.983Z</code>.</p>
  
  <p>I then try to compare the 2 dates using this function:</p>
  
  <pre><code>function checkExceedLimit (props) {
      exceedLimit = 0;
      props.items.map((item) =&gt; {
          var dateLimit = moment(item.limit)
          var now = moment()
          if (item.limit != null || item != ' ' &amp;&amp; now &gt; dateLimit) {
              exceedLimit++;
              console.log(now)
              console.log(dateLimit)
          }
      })
  }
  </code></pre>
  
  <p>Basically I want to compare the <code>limit</code> from each item and add +1 to exceedLimit when the current date is passed. Yet it returns +1 for each limit even though not all of them are passed.</p>
  
  <p>Thank you for your help</p>