Skip to content
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

should we use html_date everywhere? #4017

Closed
fuzzylogic2000 opened this issue Dec 1, 2021 · 3 comments · Fixed by #4041
Closed

should we use html_date everywhere? #4017

fuzzylogic2000 opened this issue Dec 1, 2021 · 3 comments · Fixed by #4041
Labels
Dev: A11y Accessability issue, e.g. screen reader, tabbing order Dev: Refactor issues to be fixed with code refactor

Comments

@fuzzylogic2000
Copy link
Contributor

URL:
user:
expected behaviour:
behaviour: We do use our own template tag html_date in quite a few places, but seem to have forgotten in others (like here

<dd>{{ object.reference_number }}, {% trans 'updated on ' %}{% if object.modified %}{{ object.modified|date }}{% else %}{{ object.created|date }}{% endif %}</dd>
). I think we need to decide on one format and use that.
important screensize:
device & browser:
Comment/Question: The main question to answer is: is the html_date better for a11y, because it wraps the dates in a html time element? @phillimorland do you know?
def html_date(value, displayfmt=None, datetimefmt='c', **kwargs):

Screenshot?

@fuzzylogic2000 fuzzylogic2000 added Dev: Refactor issues to be fixed with code refactor Dev: A11y Accessability issue, e.g. screen reader, tabbing order labels Dec 1, 2021
@fuzzylogic2000
Copy link
Contributor Author

@sabinammm s guess was that we might not need it anymore:

It seems that the tag was created to make the date readable for screen readers. If this is no longer relevant because screen readers can now read the date without this extra parsing

@sabinammm
Copy link
Contributor

sabinammm commented Dec 3, 2021

In Browserstack tested with integrated screenreader for:

  • Windows latest Firefox (94), Firefox (86), Chrome (96), Chrome (89) on Windows 11 and Windows 10. Older Windows version have no supported screen reader.
    Reads all the text on the page and the date when the page is read in one go. This only doesn't work on Chrome 89: unless you hover over the text,

  • Safari 13.1 on macOS Catalina: If the text is selected, it is read. Tabbing through the page, only the links and title of the page are selected and read.

  • Safari & Chrome on iPad Pro 12.9 2021 iOS, v14.6 2021: no screenreader

  • Safari & Chrome on iPhone 12 Pro v14.4: no screen reader

I also checked a plan detail page with https://wave.webaim.org/ and it seems fine with the date as long as it is in a list item.

To sum up: it is legible by those screen readers tested, without the use of html_date

Question: Do we have a minimum standard yet that we use for accesssibility? @phillimorland is this enough for now to say that we do not need to use html_date anymore?

@philli-m
Copy link
Contributor

philli-m commented Dec 6, 2021

@sabinammm the a11y web standard is set by https://www.w3.org/WAI/ I would just check there for the element or if it's now deprecated, also here all html elements are listed here with their uses https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time seems like time might be a more searchn engine thing which might be useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev: A11y Accessability issue, e.g. screen reader, tabbing order Dev: Refactor issues to be fixed with code refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants