Closed adamjohnson closed 6 years ago
This is simply taking whatever Twitter passes back to us int he JSON object and outputs that. If you want to re-format you would need to write a custom function to call upon all date fields returned.
Oh wait you are saying to add that class to our output? Eg https://github.com/jasonmayes/Twitter-Post-Fetcher/blob/master/js/twitterFetcher.js#L361 and the lines below that also inject that classname
This is what we implemented:
https://www.diffchecker.com/c6wmeUaz
The tweet receives an id
, then the aria-labelledby
is added to the anchor tag for the time posted.
Here's an HTML example:
<ul>
<li>
<p class="tweet" id="tweet--1">Hey, this is my first tweet!</p>
<p class="timePosted">
<a href="#" aria-labelledby="tweet--1">Posted on Mar 8, 2018</a>
</p>
</li>
<li>
<p class="tweet" id="tweet--2">This is my second tweet.</p>
<p class="timePosted">
<a href="#" aria-labelledby="tweet--2">Posted on Mar 8, 2018</a>
</p>
</li>
</ul>
Closing as this can be achieved using advanced example and constructing own html if needed.
Steps to reproduce the issue
.timePosted
visible.Results
Twitter Post Fetcher will output links like "Posted on March 1, 2018" for each tweet posted on March 1st.
Request
WCAG 2.0 suggests links with the same link text to use either
aria-labelledby
oraria-label
. Would you consider addingaria-labelledby
to.timePosted
? Thearia-labelledby
can point to.tweet
.Here's the spec. The Siteimprove Chrome Extension is a great tool to help test accessibility issues like this. MDN Docs for
aria-labelledby
.