 |
WHATWG HTML5 Forums A Forum for HTML5 Discussions: Semantics, DOM APIs, Microdata, Canvas, WebGL, Offline Web Applications, Local Storage, WebM Video, WebSockets, Web Workers, HTML5 Drag and Drop, HTML5 Forms, Accessibility, Syntax, News, Keywords, Yet More Keywords & More.
|
| View previous topic :: View next topic |
| Author |
Message |
RichClark <small>
Joined: 05 Feb 2009 Posts: 4 Location: Manchester, UK
|
Posted: Thu Feb 05, 2009 9:56 am Post subject: The TIME Element |
|
|
Hi guys
I've got a question about using the TIME element in HTML5.
If I was wanting to write 'last january we went to.....' would it be appropriate to wrap 'last january' in a time element?
| Code: | | <p>.... <time>last january</time> we went to .....</p> |
or would you need to add a datetime attribute to it? but this wouldn't be precise enough for the attribute?
| Code: | | <p>.... <time datetime="01-2008">last january</time> we went to .....</p> |
The same applies to Archive, or Category headers/lists in Blogs for example, how would these be marked up?
| Code: |
<h3>Archives</h3>
<ul>
<li><time>Jan 2009</time></li>
<li><time>Feb 2009</time></li>
</ul>
|
THanks for your help in advance.
Cheers
Rich |
|
| Back to top |
|
 |
brucelawson <small>
Joined: 06 Feb 2009 Posts: 1
|
Posted: Fri Feb 06, 2009 3:49 pm Post subject: |
|
|
My reading of the spec is that if there is no datetime attribute, then the contents must be in YYYYMMDD format, not very friendly.
My reading of the spec is that ithe element is for precise dates or times, eg those that can be expressed YYYYMMDD, so "July 08" or "next year" aren't allowed.
Why that should be, I dunno. I can see a need for a table of imprecise dates that could be dynamically sorted by JavaScript
<time datetime="200907">July 2007</time> |
|
| Back to top |
|
 |
pigsonthewing <small>
Joined: 07 Feb 2009 Posts: 3
|
Posted: Sat Feb 07, 2009 11:59 pm Post subject: |
|
|
| brucelawson wrote: | | <time datetime="200907">July 2007</time> |
Excellent example, Bruce - and mirroring the use of dates in microformats; currently achieved most often through abuse of ABBR and for which this HTML 5 element could be an ideal solution, provided all ISO 8601 values are accepted.
Other use cases might be:
| Code: | | In 1977 nothing happened, but <time datetime="1978">the following year</time>... |
or a quote from an original source:
| Code: | | "In <time datetime="1997">the year of our lord one thousand nine hundred and ninety seven</time>" |
Last edited by pigsonthewing on Sun Feb 08, 2009 8:22 pm; edited 1 time in total |
|
| Back to top |
|
 |
Rob <small>
Joined: 26 Jan 2009 Posts: 2
|
Posted: Sun Feb 08, 2009 12:33 pm Post subject: |
|
|
| I didn't look it up but what about the attribute specifying a format for the date? I didn't think this through at all but: <time format="mm:dd:yyyy">July 21, 2009</time> might somehow be useful. |
|
| Back to top |
|
 |
pigsonthewing <small>
Joined: 07 Feb 2009 Posts: 3
|
Posted: Sun Feb 08, 2009 8:21 pm Post subject: |
|
|
| Rob wrote: | | I didn't look it up but what about the attribute specifying a format for the date? I didn't think this through at all but: <time format="mm:dd:yyyy">July 21, 2009</time> might somehow be useful. |
The microformat community rightly rejected this idea, because there are so many ways to write "July", when you tale into account in all the languages of the world, and all their abbreviations. |
|
| Back to top |
|
 |
RichClark <small>
Joined: 05 Feb 2009 Posts: 4 Location: Manchester, UK
|
Posted: Mon Feb 09, 2009 9:20 am Post subject: |
|
|
Thanks for the suggestions and examples guys, it's definately something to think about.
Can anyone from WhatWg shed any light on if this is currently under consideration? |
|
| Back to top |
|
 |
RichClark <small>
Joined: 05 Feb 2009 Posts: 4 Location: Manchester, UK
|
|
| Back to top |
|
 |
pigsonthewing <small>
Joined: 07 Feb 2009 Posts: 3
|
Posted: Fri Feb 13, 2009 10:59 am Post subject: |
|
|
| RichClark wrote: | | Code: | | <time date-month="2007-07">July 2007</time> |
|
That seems redundant; parsers should be able to determine that "2007-07" is a year and a month (per ISO 8601) rather than the author having to say so.
Indeed,
| Code: | | <time value="2007-07">July 2007</time> |
should suffice. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|