Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions common/changes/calendar-add-aria-labels_2017-04-11-20-16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Calendar: Add ARIA labels to day and month buttons",
"type": "patch"
}
],
"email": "miclo@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class CalendarDay extends BaseComponent<ICalendarDayProps, ICalendarDaySt
onKeyDown={ (ev: React.KeyboardEvent<HTMLElement>) =>
this._navigateMonthEdge(ev, day.originalDate, weekIndex, dayIndex) }
aria-selected={ day.isSelected }
aria-label={ day.originalDate.toLocaleDateString() }

@dzearing dzearing Apr 15, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I believe requires IE11, which may not work on IE10. Though we plan to not support IE10 in the near future, just to be safe here couldn't we just ask the user to pass this in? Or at least make sure that day.originalDate.toLocaleDateString exists before calling it?

id={ compareDates(navigatedDate, day.originalDate) ? activeDescendantId : null }
data-is-focusable={ true }
ref={ compareDates(navigatedDate, day.originalDate) ? 'navigatedDay' : null }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class CalendarMonth extends BaseComponent<ICalendarMonthProps, {}> {
className={ css('ms-DatePicker-monthOption', styles.monthOption) }
key={ index }
onClick={ this._selectMonthCallbacks[index] }
aria-label={ setMonth(navigatedDate, index).toLocaleString([], { month: 'long', year: 'numeric' }) }
data-is-focusable={ true }
>
{ month }
Expand Down