Accessibility in Calendar Control

27 Aug 20267 minutes to read

Web accessibility makes web content and web applications more accessible to people with disabilities. It is especially important for dynamic content changes and the development of advanced user interface controls with AJAX, HTML, JavaScript, and related technologies.

The Calendar control follows the accessibility guidelines and standards, including ADA, Section 508, WCAG 2.2 standards, and WCAG roles that are commonly used to evaluate accessibility.

The accessibility compliance for the Calendar control is outlined below.

Accessibility criteria Compatibility
WCAG 2.2 Support AA
Section 508 Support Intermediate
Screen Reader Support Yes
Right-To-Left Support Yes
Color Contrast Yes
Mobile Device Support Yes
Keyboard Navigation Support Yes
Accessibility Checker Validation Yes
Yes - All features of the component meet the requirement.
Intermediate - Some features of the component do not meet the requirement.
No - The component does not meet the requirement.

WAI-ARIA attributes

The Calendar control provides built-in compliance with WAI-ARIA specifications. WAI-ARIA support is achieved through attributes such as aria-label, aria-selected, aria-disabled, and aria-activedescendant applied to navigation buttons and disabled or active day cells.

It helps disabled persons by providing information about the widget for assistive technology in the screen readers. Calendar control contains grid role and grid cell for each day cell.

  • aria-label: This attribute provides text labels for an object for the previous and next month’s elements. It helps the screen reader object to read.

  • aria-selected: Indicates the currently selected date of the Calendar control.

  • aria-disabled: Indicates the disabled state of the Calendar control.

  • aria-activedescendant: Helps in managing the current active child of the Calendar control.

  • Role: Gives information to assistive technologies about how to handle each element in a widget.

  • Grid-cell: Defines the individual cell that can be focused and selected.

Keyboard interaction

You can use the following keys to interact with the Calendar. This control implements keyboard navigation support by following the WAI-ARIA practices.

It supports the following list of shortcut keys:

Press To do this
Up Arrow Focuses the same day of the previous week.
Down Arrow Focuses the same day of the next week.
Left Arrow Focuses the day before.
Right Arrow Focuses the next day.
Home Focuses the first day of the month.
End Focuses the last day of the month.
Page Up Focuses the same date of the previous month.
Page Down Focuses the same date of the next month.
Enter Selects the currently focused date.
Shift + Page Up Focuses the same date for the previous year.
Shift + Page Down Focuses the same date for the next year.
Control + Up Arrow Moves to the inner level of view like month to year and year to decade.
Control + Down Arrow Moves out from the depth level view like decade to year and year to month.
Control + Home Focuses the first date of the current year.
Control + End Focuses the last date of the current year.

To focus the Calendar control, use alt+t keys.

@Html.EJS().Calendar("element").Render()

<script>
    document.addEventListener('keyup', function (e) {
        if (e.altKey && e.keyCode === 84) {
            // press alt+t to focus the control.
            var calendarObj = document.getElementById("element").ej2_instances[0];
            calendarObj.element.querySelectorAll('.e-content table')[0].focus();
        }
    })
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace EJ2CoreSampleBrowser.Controllers
{
    public class CalendarController : Controller
    {
        public ActionResult sample()
        {
            return View();
        }
    }
}

View Sample in GitHub.

Ensuring accessibility

The Calendar control’s accessibility levels are ensured through an accessibility-checker and axe-core software tools during automated testing.

The accessibility compliance of the Calendar control is shown in the following sample. Open the sample in a new window to evaluate the accessibility of the Calendar control with accessibility tools.

See also