@@ -55,12 +55,12 @@ $.widget( "ui.datepicker", {
55
55
this . _on ( this . picker , {
56
56
"click .ui-datepicker-prev" : function ( event ) {
57
57
event . preventDefault ( ) ;
58
- this . date . adjust ( "M" , - 1 ) ;
58
+ this . date . adjust ( "M" , - this . options . numberOfMonths ) ;
59
59
this . refresh ( ) ;
60
60
} ,
61
61
"click .ui-datepicker-next" : function ( event ) {
62
62
event . preventDefault ( ) ;
63
- this . date . adjust ( "M" , 1 ) ;
63
+ this . date . adjust ( "M" , this . options . numberOfMonths ) ;
64
64
this . refresh ( ) ;
65
65
} ,
66
66
"click .ui-datepicker-current" : function ( event ) {
@@ -504,12 +504,24 @@ $.widget( "ui.datepicker", {
504
504
//TODO: Prevent disabled cells from being focused
505
505
this . date . refresh ( ) ;
506
506
507
- $ ( ".ui-datepicker-title" , this . picker ) . html ( this . _buildTitle ( ) ) ;
507
+ if ( this . options . numberOfMonths === 1 ) {
508
+ this . grid = $ ( this . _buildGrid ( ) ) ;
509
+ $ ( ".ui-datepicker-title" , this . picker ) . html ( this . _buildTitle ( ) ) ;
510
+ $ ( ".ui-datepicker-calendar" , this . picker ) . replaceWith ( this . grid ) ;
511
+ } else {
512
+ this . _refreshMultiplePicker ( ) ;
513
+ }
514
+ } ,
515
+ _refreshMultiplePicker : function ( ) {
516
+ var currentDate = this . date ,
517
+ i = 0 ;
508
518
509
- // TODO fix me
510
- var newGrid = $ ( this . _buildGrid ( ) ) ;
511
- this . grid = this . grid . replaceWith ( newGrid ) ;
512
- this . grid = newGrid ;
519
+ for ( ; i < this . options . numberOfMonths ; i ++ ) {
520
+ $ ( ".ui-datepicker-title" , this . picker ) . eq ( i ) . html ( this . _buildTitle ( ) ) ;
521
+ $ ( ".ui-datepicker-calendar" , this . picker ) . eq ( i ) . html ( this . _buildGrid ( ) ) ;
522
+ this . date . adjust ( "M" , 1 ) ;
523
+ }
524
+ this . date . adjust ( "M" , - this . options . numberOfMonths ) ;
513
525
} ,
514
526
open : function ( event ) {
515
527
if ( this . inline || this . isOpen ) {
0 commit comments