@@ -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
@@ -285,7 +285,7 @@ return $.widget( "ui.calendar", {
285
285
286
286
this . _addClass ( header , "ui-calendar-header-first ui-calendar-header-last" ) ;
287
287
this . element
288
- . attr ( "aria-labelledby" , this . gridId + "-title" )
288
+ . attr ( "aria-labelledby" , this . _getGridId ( ) + "-title" )
289
289
. append ( header )
290
290
. append ( this . _buildGrid ( ) ) ;
291
291
} ,
@@ -303,8 +303,8 @@ return $.widget( "ui.calendar", {
303
303
// TODO: Shouldn't we pass date as a parameter to build* fns
304
304
// instead of setting this.viewDate?
305
305
this . _setViewDate ( months [ i ] ) ;
306
- this . gridId = this . id + "-" + i ;
307
- labelledBy . push ( this . gridId + "-title" ) ;
306
+ this . _setGridId ( this . id + "-" + i ) ;
307
+ labelledBy . push ( this . _getGridId ( ) + "-title" ) ;
308
308
309
309
element = $ ( "<div>" ) ;
310
310
this . _addClass ( element , "ui-calendar-group" ) ;
@@ -351,7 +351,7 @@ return $.widget( "ui.calendar", {
351
351
352
352
_buildHeader : function ( ) {
353
353
var header = $ ( "<div>" ) ,
354
- title = $ ( "<div>" , { role : "header" , id : this . gridId + "-title" } ) ,
354
+ title = $ ( "<div>" , { role : "header" , id : this . _getGridId ( ) + "-title" } ) ,
355
355
notice = $ ( "<span>" ) . text ( ", " + this . _getTranslation ( "datePickerRole" ) ) ;
356
356
357
357
this . _addClass ( header , "ui-calendar-header" , "ui-widget-header ui-helper-clearfix" )
@@ -365,7 +365,7 @@ return $.widget( "ui.calendar", {
365
365
} ,
366
366
367
367
_buildTitle : function ( ) {
368
- var title = $ ( "<div>" , { role : "alert" , id : this . gridId + "-month-label" } ) ,
368
+ var title = $ ( "<div>" , { role : "alert" , id : this . _getGridId ( ) + "-month-label" } ) ,
369
369
month = this . _buildTitleMonth ( ) ,
370
370
year = this . _buildTitleYear ( ) ;
371
371
@@ -392,7 +392,7 @@ return $.widget( "ui.calendar", {
392
392
role : "grid" ,
393
393
tabindex : 0 ,
394
394
"aria-readonly" : true ,
395
- "aria-labelledby" : this . gridId + "-month-label" ,
395
+ "aria-labelledby" : this . _getGridId ( ) + "-month-label" ,
396
396
"aria-activedescendant" : this . _getDayId ( this . _getDate ( ) )
397
397
} ) ;
398
398
@@ -464,7 +464,7 @@ return $.widget( "ui.calendar", {
464
464
"role='gridcell'" ,
465
465
"aria-selected='" + ( this . _isCurrent ( day ) ? true : false ) + "'" ,
466
466
"aria-label='" + dayName + ", " + this . _format ( dateObject ) + "'" ,
467
- "aria-describedby='" + this . gridId + "-month-label'"
467
+ "aria-describedby='" + this . _getGridId ( ) + "-month-label'"
468
468
] ,
469
469
selectable = ( day . selectable && this . _isValid ( dateObject ) ) ;
470
470
@@ -664,6 +664,14 @@ return $.widget( "ui.calendar", {
664
664
} ) ;
665
665
} ,
666
666
667
+ _getGridId : function ( ) {
668
+ return this . gridId ;
669
+ } ,
670
+
671
+ _setGridId : function ( id ) {
672
+ this . gridId = id ;
673
+ } ,
674
+
667
675
_getDate : function ( ) {
668
676
return this . date ;
669
677
} ,
0 commit comments