title: How can I make this date optional in jQuery Validation?
body: <p>I have a datepicker on a previously required date field. I am attempting to make it no longer required, but I'm not seeing how to do that.</p>
  
  <p>The form is using <a href="http://jqueryvalidation.org/documentation" rel="nofollow">jQuery Validation</a>. I see there is a required attribute that you can set to false, but the error appears still. Here is the code I am using:</p>
  
  <pre><code>setUpValidationForDates: function() {
    $('input.datepicker').each(function(i, el) {
      $.validator.addMethod('sDateFormat', function(value, element, param) {
        return String(value).match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}/);
      }, 'Must have format YYYY-MM-DD');
      $(el).rules('add', {
        required: false,
        sDateFormat: true,
        validDateString: true,
      });
    });
  }
  </code></pre>
  
  <p>The message seen about, "Must have format YYYY-MM-DD" is showing when the field is empty. I need it to validate if a value is present, but allow empty values. How can I accomplish this, as required: false does not seem to be working as I would expect.</p>
  
  <p>Thanks</p>