title: Disable past dates in bootstrap date picker
body: <p>I have used the date input form derived from:</p>
  
  <blockquote>
    <p>Youderian, C. <a href="https://formden.com/blog/tag/date-picker" rel="nofollow noreferrer">How to Add a Date Picker to a Bootstrap Form</a>. <em>FormDen</em>. [Blog]. 2015-10-27.</p>
  </blockquote>
  
  <p>But I am unable to disable the past dates. I tried the following; according to <a href="https://github.com/uxsolutions/bootstrap-datepicker/issues/438" rel="nofollow noreferrer">an issue</a> in GitHub, but it didn't work for me.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    var date_input = $('input[name="date"]'); //our date input has the name "date"
    var container = $('.bootstrap-iso form').length &gt; 0 ? $('.bootstrap-iso form').parent() : "body";
    date_input.datepicker({
      format: 'mm/dd/yyyy',
      container: container,
      todayHighlight: true,
      autoclose: true,
    })
  })
  $(function() {
    var nowDate = new Date();
    var today = new Date(nowDate.getFullYear(), nowDate.getMonth(),
      nowDate.getDate(), 0, 0, 0, 0);
    $('#date').datepicker({
      startDate: today
    });
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.5/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js"&gt;&lt;/script&gt;
  
  &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/css/tether.min.css" rel="stylesheet"/&gt;
  &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" rel="stylesheet"/&gt;
  &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.min.css" rel="stylesheet"/&gt;
  
  &lt;div class="bootstrap-iso"&gt;
    &lt;div class="container-fluid"&gt;
      &lt;div class="row"&gt;
        &lt;div class="col-md-6 col-sm-6 col-xs-12"&gt;
          &lt;form class="form-horizontal" method="post"&gt;
            &lt;div class="form-group "&gt;
              &lt;label class="control-label col-sm-2" for="date"&gt;
                Date
              &lt;/label&gt;
              &lt;div class="col-sm-10"&gt;
                &lt;input class="form-control" id="date" name="date" placeholder="MM/DD/YYYY" type="text" /&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;div class="col-sm-10 col-sm-offset-2"&gt;
                &lt;button class="btn btn-primary " name="submit" type="submit"&gt;
                  Submit
                &lt;/button&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>