title: Bootstrap datepicker setting startdate fails
body: <p>I am using the Bootstrap Datapicker script (Link <a href="https://bootstrap-datepicker.readthedocs.io/en/latest/" rel="nofollow noreferrer">here</a>) and having problems setting the startdate.</p>
  
  <blockquote>
    <p><strong>Option: startDate</strong></p>
    
    <p>Date or String. Default: Beginning of time</p>
    
    <p>The earliest date that may be selected; all earlier dates will be disabled.</p>
    
    <p>Date should be in local timezone. String must be parsable with <code>format</code>.</p>
  </blockquote>
  
  <p><strong>JavaScript:</strong></p>
  
  <pre><code>function initializeDatePicker() {
      if ($.isFunction($.fn.datepicker)) {
          var datepickerLang = lang;
          if (datepickerLang === "nl") {
              datepickerLang = "nl-BE";
          }
  
          $(".input-group.date input").datepicker({
              autoclose: true,
              todayBtn: "linked",
              clearBtn: true,
              todayHighlight: true,
              language: datepickerLang,
              format: "dd-mm-yyyy",
              startDate: $(this).data("startdate")
          });
      }
  }
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div class="input-group date small"&gt;
      &lt;input id="StartDate" class="form-control" name="StartDate" value="" data-is-required="True" data-startdate="01-12-2016" type="text"&gt;
      &lt;div class="input-group-addon"&gt;
          &lt;span class="fa fa-calendar"&gt;&lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>What does work?</strong></p>
  
  <p>If I hardcode the <code>startdate</code> to:</p>
  
  <pre><code>startDate: new Date() =&gt; today
  
  startDate: "01-12-2016"
  </code></pre>
  
  <p><strong>What does not work?</strong></p>
  
  <p>If I try to get the date from my data attribute nothing works.</p>
  
  <pre><code>startDate: new Date($(this).data("startdate")) =&gt; returns 'Date Invalid'
  
  startDate: $(this).data("startdate")
  </code></pre>
  
  <p>I don't understand what is wrong and how I can fix it.</p>