Skip to content

docs(material/datepicker): require communicating date format for a11y #24682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

zarend
Copy link
Contributor

@zarend zarend commented Mar 28, 2022

In the accessibility section of the datepicker documentation, require communicating the date format
string (e.g. 'MM/DD/YYYY'). Update datepicker examples to show the date format string via
<mat-hint> and use 'en-US' as the locale.

This commit only changes examples and does not affect source code.

Addresses #11127

@zarend zarend added Accessibility This issue is related to accessibility (a11y) docs This issue is related to documentation merge safe area: material/datepicker labels Mar 28, 2022
@zarend zarend requested a review from jelbourn March 28, 2022 21:25
@zarend zarend force-pushed the display-date-formats branch from d032234 to 70181bb Compare March 28, 2022 22:07
@zarend zarend added the target: patch This PR is targeted for the next patch release label Mar 28, 2022
@@ -1,5 +1,6 @@
<mat-form-field class="example-form-field" appearance="fill">
<mat-label>First campaign</mat-label>
<mat-hint>MM/DD/YYYY – MM/DD/YYYY</mat-hint>
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if users would actually infer that this is a date format. I would assume that the screen reader will read it out as an abbreviation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what is looks like visually.

image

image

The hint visually matches the input above it. I tested this on VoiceOver and it announced this as an abbreviation.

Copy link
Member

Choose a reason for hiding this comment

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

That's what I meant. Would users actually know that the abbreviation refers to the date format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm. Showing the date format as an abbreviation is fairly conventional AFAIK.

As far as screen readers as concerned, I would recommend not dictating exactly how it is announced. People get used to how screen readers work and trying to control too much what the screenreader says can make it worse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using abbreviations is not necessarily the only correct way to communicate the date format. What I'm going for, is keeping things conventional for these examples.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems standard to me as well, I see many websites showing hints like this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW, we have another component internally that uses abbreviations.

@zarend zarend force-pushed the display-date-formats branch from 70181bb to 8d7314f Compare March 30, 2022 01:20
@zarend zarend requested a review from crisbeto March 30, 2022 01:21
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM except for one minor suggestion

@zarend zarend force-pushed the display-date-formats branch from 8d7314f to 9869f46 Compare April 2, 2022 00:04
@zarend zarend added the action: merge The PR is ready for merge by the caretaker label Apr 2, 2022

Verified

This commit was signed with the committer’s verified signature.
Byron Sebastian Thiel
In the accessibility section of the datepicker documentation, require communicating the date format
string (e.g. 'MM/DD/YYYY'). Update datepicker examples to show the date format string via
`<mat-hint>` and use 'en-US' as the locale.

This commit only changes examples and does not affect source code.

Addresses angular#11127
@zarend zarend force-pushed the display-date-formats branch from 9869f46 to c6a7aaa Compare April 4, 2022 23:24
@amysorto amysorto merged commit 6118b68 into angular:master Apr 8, 2022
amysorto pushed a commit that referenced this pull request Apr 8, 2022

Verified

This commit was signed with the committer’s verified signature.
Byron Sebastian Thiel
…#24682)

In the accessibility section of the datepicker documentation, require communicating the date format
string (e.g. 'MM/DD/YYYY'). Update datepicker examples to show the date format string via
`<mat-hint>` and use 'en-US' as the locale.

This commit only changes examples and does not affect source code.

Addresses #11127

(cherry picked from commit 6118b68)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) action: merge The PR is ready for merge by the caretaker area: material/datepicker docs This issue is related to documentation target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants