title: Programmatically change datelimit in JQUERY calendar control
body: <p>I seem to be having a problem setting the dateLimit of the JQuery calendar control, programatically.</p>
  
  <p>When the page initially load, I setup the calendar control like so:</p>
  
  <pre><code>$('#dashboard-report-range').daterangepicker({
                  opens: (App.isRTL() ? 'right' : 'left'),
                  startDate: moment($('#hidLatestData_Date').val()).add('days', -6),
                  endDate: moment($('#hidLatestData_Date').val()),//.add('days', 1),
                  minDate: '01/01/2012',
                  maxDate: moment($('#hidLatestData_Date').val()),//.add('days', 2),
                  dateLimit: {
                      days: 6
                  },
                  showDropdowns: false,
                  showWeekNumbers: true,
                  timePicker: false,
                  timePickerIncrement: 1,
                  timePicker12Hour: true,
                  ranges: {
                      'Today': [moment(), moment().add('days', 0)],
                      'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1).add('days', 0)],
                      'Last 7 Days': [moment().subtract('days', 6), moment()]//,
                      //'Last 30 Days': [moment().subtract('days', 29), moment()],
                      //'This Month': [moment().startOf('month'), moment().endOf('month')],
                      //'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
                  },
                  buttonClasses: ['btn'],
                  applyClass: 'blue',
                  cancelClass: 'default',
                  format: 'DD/MM/YYYY',
                  separator: ' to ',
                  locale: {
                      applyLabel: 'Apply',
                      fromLabel: 'From',
                      toLabel: 'To',
                      customRangeLabel: 'Custom Range',
                      daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
                      monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
                      firstDay: 1
                  }
              }
  </code></pre>
  
  <p>On the page, I have a drop down list. If a specific selection is made, I want to change the dateLimit value to 1, rather than 6.</p>
  
  <p>I have tried a bunch of different options, but nothing seems to be working for me. Any help would be greatly appreciated.</p>
  
  <p>I am actually having to change the start time too, but the code for (below) works 100% correctly.</p>
  
  <pre><code>$("#dashboard-report-range").datepicker('option', { startDate: new Date(hidEndDate)});
  </code></pre>
  
  <p>These are the options I have tried, plus others I cannot even remember anymore:</p>
  
  <pre><code>    $("#dashboard-report-range").datepicker('option', { dateLimit: "days:1"});
  
  $("#dashboard-report-range").datepicker('option', { dateLimit: { "days":"1"}});
  
  $("#dashboard-report-range").datepicker('option',  dateLimit: { "days":"1"});
  
  $("#dashboard-report-range").datepicker('option', dateLimit: "days:1");
  
  $("#dashboard-report-range").datepicker('option', dateLimit, "days:1");
  
  $("#dashboard-report-range").datepicker('option',  "dateLimit", "days:1"  );
  </code></pre>