[whatwg] <time>
Tom Duhamel
tom420.duhamel at gmail.com
Mon Mar 16 13:10:33 PDT 2009
It seems that pretty much everyone agrees on this:
- Allow the use of an alternate calendar, but only Gregorian is required to
be understood by user agents
- We only require the user agent to display dates; they are free to do more
if they like (conversion, ...) but are not required to.
- Calendar is specified in a new attribute ('calendar' or something similar)
and the value of 'datetime' attibute is specified in the calendar specified
by that new attribute
- If 'datetime' attribute is missing, try to interpret the content as an ISO
date. User agent could print the content as is, or print in a more friendly
way if desired (in case it was successfully read as a valid ISO date).
- If content is missing, print 'datetime' attribute (in a friendly way, if
desired and set by user, or simply as is if unable to do better)
- If both content and datetime are present, print content on page and show a
representation of the date in datetime with a mechanism such as a tool tip
Does the following examples make sense?
[For theses examples, I'm assuming our user agent only follow the bare
minimum requirements we are setting as a draft (that is, they only
understand Gregorian), I understand that some specialized user agents might
(and probably will) perform conversion as set by the user in the preferences
(or some other mean) or do anything else they like.
I am assuming my particular user agent is set to print in American, long
format, but of course I expect user agents to display dates in an
appropriate way which the user has a control over.]
<time datetime="2009-03-16">Today</time>
Tool tip shows: "March 16, 2009"
<time calendar="Julian" datetime="0668-05-11">Some date well in the
past</time>
Tool tip shows: "May 11, 668 (Julian)"
Content could be a Gregorian conversion as performed by an author, or simply
the Julian date again, printed in human readable. User agent should print
what ever content the author wrote.
<time>2009-03-16</time>
Printing directly on the page, no tool tip: "March 16, 2009"
<time>Today</time>
The user agent can't do anything, but print "Today" directly
Content could be anything the user agent cannot interpret as a date/time
Note: This is an invalid use, so this would actually be the default
behavior, as I understand.
<time>16 mars 2009</time>
The user agent could, but is not required to, make an effort to interpret
the date and do whatever it likes with it. However, if the date provided
cannot be interpreted as ISO 8601 it could simply print the content as is
without any change. In this example, if the user agent is able to understand
this French date, the tool tip could be "March 16, 2009" (assuming a user
agent set to display dates as American long format)
<time calendar="Mayan" datetime="12-11-10-09-08">A date</time> is printed on
the statue
Printed on the page: "A date is printed on the statue"
Tool tip shows: "12-11-10-09-08 (Mayan Long Count)"
In this example, my user agent does not understand the date, and simply
display in a non converted way
Here is a good one:
<time datetime="2009-03-47">A non valid Gregorian date</time>
What shoud the tool tip reads?
"March 47, 2009" (print, without validation... which over time could help
user agents which do not understand non Gregorian when calendar attribute is
set to something other than Gregorian)
"2009-03-47" (as date is not valid, simply prints original value without any
conversion)
"Invalid Date" (just an error message)
or just do nothing, since the date is not valid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090316/ca68b418/attachment-0002.htm>
More information about the whatwg
mailing list