diff --git a/packages/@react-aria/calendar/src/useCalendarCell.ts b/packages/@react-aria/calendar/src/useCalendarCell.ts index aabeac2f9a5..4da457c3f2d 100644 --- a/packages/@react-aria/calendar/src/useCalendarCell.ts +++ b/packages/@react-aria/calendar/src/useCalendarCell.ts @@ -310,7 +310,8 @@ export function useCalendarCell(props: AriaCalendarCellProps, state: CalendarSta role: 'gridcell', 'aria-disabled': !isSelectable || undefined, 'aria-selected': isSelected || undefined, - 'aria-invalid': isInvalid || undefined + 'aria-invalid': isInvalid || undefined, + 'aria-current': isDateToday ? 'date' : undefined }, buttonProps: mergeProps(pressProps, { onFocus() { diff --git a/packages/react-aria-components/test/Calendar.test.js b/packages/react-aria-components/test/Calendar.test.js index ba590708101..56304aac596 100644 --- a/packages/react-aria-components/test/Calendar.test.js +++ b/packages/react-aria-components/test/Calendar.test.js @@ -365,4 +365,23 @@ describe('Calendar', () => { await user.keyboard('[ArrowLeft][Enter]'); expect(calendar.getByLabelText(/selected/)).toBe(day16); }); + + it('should set aria-current="date" on today’s cell', () => { + const today = new Date(); + const day = today.getDate(); + const {getAllByRole} = render( + + + {date => } + + + ); + const cells = getAllByRole('gridcell'); + const todayCell = cells.find(cell => { + const btn = cell.querySelector('div,span'); + return btn && btn.textContent === String(day); + }); + expect(todayCell).toHaveAttribute('aria-current', 'date'); + }); + });