aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2016-04-13 23:30:44 +0200
committerFelix Nagel <info@felixnagel.com>2016-09-28 18:28:34 +0200
commite02ef66389a904db44e151194d41e8e40b8e64ac (patch)
treeab82a3d1640ae4b9c07b82c08aa841bcc0dffc2c
parentf2bbea2cec809e0b35105c99bf3e14192e9ba88c (diff)
downloadjquery-ui-e02ef66389a904db44e151194d41e8e40b8e64ac.tar.gz
jquery-ui-e02ef66389a904db44e151194d41e8e40b8e64ac.zip
Calendar: Add missing day cell and month label ARIA attributes
-rw-r--r--ui/widgets/calendar.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/ui/widgets/calendar.js b/ui/widgets/calendar.js
index 767f285e9..6b8be9264 100644
--- a/ui/widgets/calendar.js
+++ b/ui/widgets/calendar.js
@@ -321,7 +321,7 @@ return $.widget( "ui.calendar", {
_buildTitlebar: function() {
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() +
"</div>" +
"<span class='ui-helper-hidden-accessible'>, " +
@@ -402,11 +402,16 @@ return $.widget( "ui.calendar", {
_buildDayCell: function( day ) {
var content = "",
+ dateObject = new Date( day.timestamp ),
+ dayName = this._calendarDateOptions.formatWeekdayFull( dateObject ),
attributes = [
"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 ) {
attributes.push( "id='" + this.id + "-" + day.year + "-" + day.month + "-" + day.date + "'" );