Skip to content

Commit

Permalink
fix(Calendar): aria-label format to day, month, year (#18146)
Browse files Browse the repository at this point in the history
* Calenda :announce the date in the order [day], [month], [year]

* Change files

* Calendr:announce the date in the order [day], [month], [year]

* Update packages/react/src/components/CalendarDayGrid/CalendarGridDayCell.tsx

Co-authored-by: Makoto Morimoto <Humberto.Morimoto@microsoft.com>

* Update packages/react/src/components/CalendarDayGrid/CalendarGridDayCell.tsx

Co-authored-by: Makoto Morimoto <Humberto.Morimoto@microsoft.com>

* Updated jest snapshot to include spaces

Co-authored-by: Makoto Morimoto <Humberto.Morimoto@microsoft.com>
  • Loading branch information
tringakrasniqi and khmakoto authored May 14, 2021
1 parent 2fcfc2b commit 6f5eb94
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Calenda :announce the date in the order [day], [month], [year]",
"packageName": "@fluentui/react",
"email": "tkrasniqi@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ export const CalendarGridDayCell: React.FunctionComponent<ICalendarGridDayCellPr
}
};

let ariaLabel = dateTimeFormatter.formatMonthDayYear(day.originalDate, strings);
let ariaLabel =
day.originalDate.getDate() +
', ' +
strings.months[day.originalDate.getMonth()] +
', ' +
day.originalDate.getFullYear();

if (day.isMarked) {
ariaLabel = ariaLabel + ', ' + strings.dayMarkedAriaLabel;
}
Expand Down
Loading

0 comments on commit 6f5eb94

Please sign in to comment.