@@ -89,7 +89,7 @@ return $.widget( "ui.calendar", {
89
89
90
90
_create : function ( ) {
91
91
this . id = this . element . uniqueId ( ) . attr ( "id" ) ;
92
- this . gridId = this . id ;
92
+ this . _setGridId ( this . id ) ;
93
93
this . labels = this . options . labels ;
94
94
this . buttonClickContext = this . element [ 0 ] ;
95
95
@@ -287,7 +287,7 @@ return $.widget( "ui.calendar", {
287
287
288
288
this . _addClass ( header , "ui-calendar-header-first ui-calendar-header-last" ) ;
289
289
this . element
290
- . attr ( "aria-labelledby" , this . gridId + "-title" )
290
+ . attr ( "aria-labelledby" , this . _getGridId ( ) + "-title" )
291
291
. append ( header )
292
292
. append ( this . _buildGrid ( ) ) ;
293
293
} ,
@@ -305,8 +305,8 @@ return $.widget( "ui.calendar", {
305
305
// TODO: Shouldn't we pass date as a parameter to build* fns
306
306
// instead of setting this.viewDate?
307
307
this . _setViewDate ( months [ i ] ) ;
308
- this . gridId = this . id + "-" + i ;
309
- labelledBy . push ( this . gridId + "-title" ) ;
308
+ this . _setGridId ( this . id + "-" + i ) ;
309
+ labelledBy . push ( this . _getGridId ( ) + "-title" ) ;
310
310
311
311
element = $ ( "<div>" ) ;
312
312
this . _addClass ( element , "ui-calendar-group" ) ;
@@ -353,7 +353,7 @@ return $.widget( "ui.calendar", {
353
353
354
354
_buildHeader : function ( ) {
355
355
var header = $ ( "<div>" ) ,
356
- title = $ ( "<div>" , { role : "header" , id : this . gridId + "-title" } ) ,
356
+ title = $ ( "<div>" , { role : "header" , id : this . _getGridId ( ) + "-title" } ) ,
357
357
notice = $ ( "<span>" ) . text ( ", " + this . _getTranslation ( "datePickerRole" ) ) ;
358
358
359
359
this . _addClass ( header , "ui-calendar-header" , "ui-widget-header ui-helper-clearfix" )
@@ -367,7 +367,7 @@ return $.widget( "ui.calendar", {
367
367
} ,
368
368
369
369
_buildTitle : function ( ) {
370
- var title = $ ( "<div>" , { role : "alert" , id : this . gridId + "-month-label" } ) ,
370
+ var title = $ ( "<div>" , { role : "alert" , id : this . _getGridId ( ) + "-month-label" } ) ,
371
371
month = this . _buildTitleMonth ( ) ,
372
372
year = this . _buildTitleYear ( ) ;
373
373
@@ -394,7 +394,7 @@ return $.widget( "ui.calendar", {
394
394
role : "grid" ,
395
395
tabindex : 0 ,
396
396
"aria-readonly" : true ,
397
- "aria-labelledby" : this . gridId + "-month-label" ,
397
+ "aria-labelledby" : this . _getGridId ( ) + "-month-label" ,
398
398
"aria-activedescendant" : this . _getDayId ( this . _getDate ( ) )
399
399
} ) ;
400
400
@@ -466,7 +466,7 @@ return $.widget( "ui.calendar", {
466
466
"role='gridcell'" ,
467
467
"aria-selected='" + ( this . _isCurrent ( day ) ? true : false ) + "'" ,
468
468
"aria-label='" + dayName + ", " + this . _format ( dateObject ) + "'" ,
469
- "aria-describedby='" + this . gridId + "-month-label'"
469
+ "aria-describedby='" + this . _getGridId ( ) + "-month-label'"
470
470
] ,
471
471
selectable = ( day . selectable && this . _isValid ( dateObject ) ) ;
472
472
@@ -666,6 +666,14 @@ return $.widget( "ui.calendar", {
666
666
} ) ;
667
667
} ,
668
668
669
+ _getGridId : function ( ) {
670
+ return this . gridId ;
671
+ } ,
672
+
673
+ _setGridId : function ( id ) {
674
+ this . gridId = id ;
675
+ } ,
676
+
669
677
_getDate : function ( ) {
670
678
return this . date ;
671
679
} ,
0 commit comments