title: Date compare format
body: <p>I'm creating a datepicker (Materialize) system into my webapp and I'm facing to a weird problem with date comparaison (see below). I would like to warn the user that if he want a date witch is less than 48hours, he will pay more. To do that I wrote a script to check the changes of the input start_date. </p>
  
  <pre><code>('#event_start_at_date').on('change', function(){ 
    var limit = moment().add(2, 'days').format("DD/MM/YYYY")
    if($('#event_d_script').val() != "true"){
      if ( $(this).val() &lt;= moment() ){
        // the date is impossible
        $(this).val(date_min)
      } else if ( $(this).val() &lt;= limit ) { 
        // the date is less than 48h from today
        $('#date_warning').slideDown();
        if($('#event_urgent').val() == "false"){
          var amount = parseFloat($('#event_price').val()) + 10
          $('#offer_footer_price_val').text(amount);
          $('#event_price').val(amount)
          $('#event_urgent').val("true");
          $('#event_urgent_checkbox').attr('checked', true);
        }
      } else{
        // the date is more than 48h from today
        $('#date_warning').slideUp();
        if($('#event_urgent').val() == "true"){
          // The previous date was urgent
          var amount = parseFloat($('#event_price').val()) - 10
          $('#offer_footer_price_val').text(amount);
          $('#event_price').val(amount);
          $('#event_urgent').val("false");
          $('#event_urgent_checkbox').attr('checked', false);
        }
      }
      if($('#event_end_at_date').val() &lt;= $(this).val() ){
        // The end can't be before the start
        $('#event_end_at_date').val($(this).val())
      }
    }
  });
  </code></pre>
  
  <p>My error = The comparison is made only on the day, not on the full date. </p>
  
  <p>For example, if today is November 12, the increase is applied until the November 14. But also all the days before the 14 for the others months (ex: 12 dec).</p>
  
  <p>I thing that's an error of date format, but I cannot fix it</p>