title: Disable year for JQueryUI DatePicker
body: <p>I'm trying to disable years from my "YearPicker?", it's a DatePicker where you're only able to pick years. I need to disable all years and enable only a range of years (From 2012 to now, for example). </p>
  
  <p>I'm using the JQueryUI DatePicker and it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/YsjxA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YsjxA.png" alt="enter image description here"></a></p>
  
  <p><strong>CSS:</strong></p>
  
  <pre><code>&lt;link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"&gt;
     &lt;style&gt;
          .ui-datepicker-calendar {
              display: none;
          }        
      &lt;/style&gt;
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>&lt;script src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      $( function() {
          $('#datepicker').datepicker({
              viewMode: 2,
              format: 'yyyy',
              maxDate: new Date(new Date().getFullYear(), 11, 31),
              minDate: new Date(2012, 0, 1)
          });
      })
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;label&gt;Year: &lt;input class="form-control" type="text" id="datepicker"&gt;&lt;/label&gt;
  </code></pre>