custom date formats

Events happening in the community are now at Drupal community events on www.drupal.org.
hanno's picture

When publishing a calendar or an overview of news items, the dates are often in a short custom format, like '12 Sep', or '2/7'. From an accessibility point of view, should a theme or view also provide the full date format?
With abbreviated months should we use the abbr tag for the month? like:
<abbr title="August">Aug.</abbr> (http://www.littlewebhut.com/html/abbr_tag/)

Comments

Seems like a good best practice

mgifford's picture

This would point to some changes that should be made to generic date handling in core I expect.

About best practice, what

hanno's picture

About best practice, what would that be ?
1. Will relative to absolute dates (2 days ago or 7/2 to 7 February 2011) improve accessibility and/or usability?
2. Will number (2/7) to text (7 February) improve accessibility and/or usability?
3. Would <abbr title="7 February 2011">2/7</abbr> be a valid or invalid use of the abbr tag, or are there other ways to include an alternative date format?

EDIT: in html5 we will get a new tag 'time' that exactly handles relative date issues (with the absolute date in attribute 'datetime'): http://www.w3schools.com/html5/att_time_datetime.asp :
<time datetime="2008-02-14">today</time>
Great, that seems to be the way forward, I assume also for accessibility. Time tag is not being implemented yet in the date module afaik.

We are adding a

Everett Zufelt's picture

We are adding a theme_datetime() function at http://drupal.org/node/1183250

This function will, by default, return a <time> element.

Accessibility Consultant & Web Developer - Zufelt.ca
@ezufelt on Twitter | LinkedIn profile

Everett, that is great to

hanno's picture

Everett, that is great to hear to you started implementing this in Drupal 8! As soon as this function is in, the date module can use it. Do you think it would be best practice for accessibility to use abbr tag for abbreviated months, or is that over the top?

Accessibility

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: