Skip to content

Commit

Permalink
fix(DatePicker): Make date picker accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
jbirori authored and pauljeter committed Sep 16, 2019
1 parent 262a5d1 commit 5446a0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions react/src/lib/DatePicker/DatePickerCalendar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class DatePickerCalendar extends React.Component {
const allPrevDaysDisabled = shouldPrevMonthDisable(date, minDate);
return (
<Icon
ariaLabel={previousArialLabel}
ariaLabel={`${previousArialLabel} month, ${subtractMonths(date.clone(), 1).format("MMMM")}`}
disabled={allPrevDaysDisabled}
onClick={this.decreaseMonth}
name='arrow-left_16'
Expand All @@ -98,10 +98,9 @@ class DatePickerCalendar extends React.Component {
const renderNextMonthButton = () => {
const { maxDate } = this.props;
const allNextDaysDisabled = shouldNextMonthDisable(date, maxDate);

return (
<Icon
ariaLabel={nextArialLabel}
ariaLabel={`${nextArialLabel} month, ${addMonths(date.clone(), 1).format("MMMM")}`}
disabled={allNextDaysDisabled}
onClick={this.increaseMonth}
name='arrow-right_16'
Expand Down
6 changes: 4 additions & 2 deletions react/src/lib/DatePicker/DatePickerDay/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ class DatePickerDay extends React.Component {
`${(isOutsideMonth && ` md-datepicker__day--outside-month`) || ''}`
}
onClick={this.handleClick}
ariaLabel={`${getDate(day)}`}
ariaLabel={`${day.format("dddd, MMMM Do YYYY")}`}
aria-selected={isSelected}
tabIndex={-1}
>
{getDate(day)}
<div aria-label={day.format("dddd, MMMM Do YYYY")}>
{getDate(day)}
</div>
</Button>
);
}
Expand Down

0 comments on commit 5446a0b

Please sign in to comment.