title: Set min max values per year for Daterangepicker
body: <p>Although i have found some general answers to my question, i couldn't find any which solves my specific problem. </p>
  
  <p>I have developed a backend for some users, where they can view/edit the availability of their hotel rooms for the whole selected year. I am using HTML/PHP/MySQL to display the availability values of the year they want. There are 365 inputs in this form (each input represents a single day. That means that there are 365 inputs, depending on the selected year). Then i use the daterangepicker jQuery plugin, so he can selecte date ranges and change the availability values. They can only view/edit availabilities for the <strong>current</strong> and the <strong>next</strong> year.</p>
  
  <p>I let them switch from current year to next year and backwards with this code:</p>
  
  <pre><code>&lt;a class="btn btn-primary" href="https://domain.com/backend/availability/edit_availability/11/0"&gt;2016&lt;/a&gt;
  &lt;a class="btn btn-default" href="https://domain.com/backend/availability/edit_availability/11/1"&gt;2017&lt;/a&gt;
  </code></pre>
  
  <p>For the record, i check the last href parameter to understand the selected year. Current year is /0 and next year is /1. I want to display only current and next year.</p>
  
  <p>With the below code they select a date range, set the availability number and 'Fill' the calendar with the given availability number:</p>
  
  <pre><code>&lt;input id="availability_dates" class="form-control" type="text" required="required" value="" name="availability_dates"&gt;
  &lt;input id="availability_number" class="form-control col-md-7 col-xs-12" type="text" name="availability_number"&gt;
  &lt;button id="fill-availabilities" class="btn btn-success" type="submit"&gt;Fill&lt;/button&gt;
  
  &lt;script&gt;
  $('#availability_dates').daterangepicker(
   {
      format: 'DD/MM/YYYY'
   }, function (start, end, label) {
      console.log(start.toISOString(), end.toISOString(), label);
   });
  &lt;/script&gt;
  </code></pre>
  
  <p>I grab his desired year like this:</p>
  
  <pre><code>&lt;?php
  if ($year == '0') {
     $display_year = date('Y');
     $other_year = date('Y', strtotime('+1 year'));
  } else {
     $display_year = date('Y', strtotime('+1 year'));
     $other_year = date('Y');
  }
  ?&gt;
  </code></pre>
  
  <p>Anyway, that's a sort briefing. What i am trying to do is, set the minimum and maximum dates to the daterangepicker <strong>just for the selected year</strong>. If they view 2016, i want to limit the daterangepicker to 1st of January - 31st December of 2016 only. Same for the next year 2017 and so on. </p>
  
  <p>As you can see, years are grabbed dynamically, so i need a "script" where the daterangepicker will work even if we are in 2018 or 2020 etc.</p>
  
  <p>I'm sorry for the long post, i've tried to explain a lot more than needed in case someone has a better solution/idea.</p>
  
  <p>Thank you in advance</p>