Skip to content

Commit e02ef66

Browse files
committed
Calendar: Add missing day cell and month label ARIA attributes
1 parent f2bbea2 commit e02ef66

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ui/widgets/calendar.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ return $.widget( "ui.calendar", {
321321

322322
_buildTitlebar: function() {
323323
return "<div role='header' id='" + this.gridId + "-title'>" +
324-
"<div id='" + this.gridId + "-month-label' class='ui-calendar-title'>" +
324+
"<div id='" + this.gridId + "-month-label' role='alert' class='ui-calendar-title'>" +
325325
this._buildTitle() +
326326
"</div>" +
327327
"<span class='ui-helper-hidden-accessible'>, " +
@@ -402,11 +402,16 @@ return $.widget( "ui.calendar", {
402402

403403
_buildDayCell: function( day ) {
404404
var content = "",
405+
dateObject = new Date( day.timestamp ),
406+
dayName = this._calendarDateOptions.formatWeekdayFull( dateObject ),
405407
attributes = [
406408
"role='gridcell'",
407-
"aria-selected='" + ( this._isCurrent( day ) ? true : false ) + "'"
409+
"aria-selected='" + ( this._isCurrent( day ) ? true : false ) + "'",
410+
"aria-label='" + dayName + ", " + this._format( dateObject ) + "'",
411+
"aria-describedby='" + this.gridId + "-month-label'",
412+
"aria-hidden='" + true + "'"
408413
],
409-
selectable = ( day.selectable && this._isValid( new Date( day.timestamp ) ) );
414+
selectable = ( day.selectable && this._isValid( dateObject ) );
410415

411416
if ( day.render ) {
412417
attributes.push( "id='" + this.id + "-" + day.year + "-" + day.month + "-" + day.date + "'" );

0 commit comments

Comments
 (0)