mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Calendar: Add missing day cell and month label ARIA attributes
This commit is contained in:
parent
f2bbea2cec
commit
e02ef66389
@ -321,7 +321,7 @@ return $.widget( "ui.calendar", {
|
|||||||
|
|
||||||
_buildTitlebar: function() {
|
_buildTitlebar: function() {
|
||||||
return "<div role='header' id='" + this.gridId + "-title'>" +
|
return "<div role='header' id='" + this.gridId + "-title'>" +
|
||||||
"<div id='" + this.gridId + "-month-label' class='ui-calendar-title'>" +
|
"<div id='" + this.gridId + "-month-label' role='alert' class='ui-calendar-title'>" +
|
||||||
this._buildTitle() +
|
this._buildTitle() +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"<span class='ui-helper-hidden-accessible'>, " +
|
"<span class='ui-helper-hidden-accessible'>, " +
|
||||||
@ -402,11 +402,16 @@ return $.widget( "ui.calendar", {
|
|||||||
|
|
||||||
_buildDayCell: function( day ) {
|
_buildDayCell: function( day ) {
|
||||||
var content = "",
|
var content = "",
|
||||||
|
dateObject = new Date( day.timestamp ),
|
||||||
|
dayName = this._calendarDateOptions.formatWeekdayFull( dateObject ),
|
||||||
attributes = [
|
attributes = [
|
||||||
"role='gridcell'",
|
"role='gridcell'",
|
||||||
"aria-selected='" + ( this._isCurrent( day ) ? true : false ) + "'"
|
"aria-selected='" + ( this._isCurrent( day ) ? true : false ) + "'",
|
||||||
|
"aria-label='" + dayName + ", " + this._format( dateObject ) + "'",
|
||||||
|
"aria-describedby='" + this.gridId + "-month-label'",
|
||||||
|
"aria-hidden='" + true + "'"
|
||||||
],
|
],
|
||||||
selectable = ( day.selectable && this._isValid( new Date( day.timestamp ) ) );
|
selectable = ( day.selectable && this._isValid( dateObject ) );
|
||||||
|
|
||||||
if ( day.render ) {
|
if ( day.render ) {
|
||||||
attributes.push( "id='" + this.id + "-" + day.year + "-" + day.month + "-" + day.date + "'" );
|
attributes.push( "id='" + this.id + "-" + day.year + "-" + day.month + "-" + day.date + "'" );
|
||||||
|
Loading…
Reference in New Issue
Block a user