title: comparing dates with momentJs
body: <p>This Meteor server code tries to find if a given date string DD/MM/YYYY is within the last 14 days or not.</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>  let date = '03/05/2017'; //DD/MM/YYYY
  
    let dayStart = moment().subtract(14, 'days').format('DD/MM/YYYY');
  
    if (moment(date).isBefore(dayStart)) {
      console.log('before');
     } else {
      console.log('after');
    }
  </code></pre>
  
  <p>This works but I get console error:  </p>
  
  <blockquote>
    <p>Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to <a href="http://momentjs.com/guides/#/warnings/js-date/" rel="nofollow noreferrer">http://momentjs.com/guides/#/warnings/js-date/</a> for more info.</p>
  </blockquote>
  
  <p>Any suggestion how to fix it so it works without the error? thx</p>