id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,blocking,blockedby
1996,datepicker - next/prev with multiple months and min/max,emielroelofsen,kbwood,"The function _canAdjustMonth is't correct.[[BR]]
[[BR]]

== Example ==
I want to show 3 months ( numberOfMonths: 3 )[[BR]]
My minimum date is 2008-01-26 ( minDate: new Date(2008, 1 - 1, 26) )[[BR]]
My maximum date is 2008-04-27 ( minDate: new Date(2008, 4 - 1, 27) )[[BR]]
hideIfNoPrevNext is set to true[[BR]]


Because of the bug in the function _canAdjustMonth I can press the next button until juni 2008.
The solution is also to calculate the numberOfMonths.



== Solution ==

== OLD FUNCTOIN ==

{{{
_canAdjustMonth: function(offset) {            
   var date = new Date(this._selectedYear, this._selectedMonth + offset, 1);
   if (offset < 0) {
      date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
   }
   return this._isInRange(date);
},
}}}


== NEW FUNCTION ==

{{{
_canAdjustMonth: function(offset) {            
   var month = offset > 0 ? 
      this._selectedMonth + offset + this._get('numberOfMonths') - 1 :
      this._selectedMonth + offset;
   var date = new Date(this._selectedYear, month, 1);
   if (offset < 0) {
      date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
   }
   return this._isInRange(date);
},
}}}


Emiel Roelofsen",bug,closed,major,1.2.2,ui,1.2.1,fixed,datepicker,emielroelofsen@…,,
