title: Datepicker - Set maximum date to 18 years ago from current date
body: <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;input type="text" name="date" id="datepicker" autocomplete="off"&gt;
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>var maxBirthdayDate = new Date();
  maxBirthdayDate.setFullYear( maxBirthdayDate.getFullYear() - 18 );
  
  $( "#datepicker" ).datepicker({
      dateFormat: 'dd.mm.yy',
      changeMonth: true,
      changeYear: true,
      maxDate: maxBirthdayDate
  });
  </code></pre>
  
  <p><strong>JSFIDDLE:</strong></p>
  
  <pre><code>https://jsfiddle.net/z13au9t6/
  </code></pre>
  
  <p><strong>PROBLEM:</strong>
  Although setting maxDate to 18 years ago is working, I cannot now select year below 1990 and months above August.</p>
  
  <p><a href="https://i.stack.imgur.com/KRpyF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KRpyF.png" alt="enter image description here"></a></p>