A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on IRC (such as one of these permanent autoconfirmed members).

Difference between revisions of "Time element"

From WHATWG Wiki
Jump to: navigation, search
(impedance match new date time inputs: overview plus note two specific missing cases.)
(add "year week only" proposal, crosslinks)
Line 15: Line 15:
 
In particular the <code>&lt;time&gt;</code> element is missing support for the following date inputs:
 
In particular the <code>&lt;time&gt;</code> element is missing support for the following date inputs:
  
* input type="month" - see proposal below.
+
* input type="month" - this would be satisfied by the [[Time_element#year_month_only|Year Month proposal]].
* input type="week" - see additional proposal.
+
* input type="week" - this would be satisfied by the [[Time_element#year_week_only|Year Week proposal]].
 +
 
 +
<div class="discussion">
 +
Opinions / discussion:
 +
* +1 [[Tantek]]
 +
* ...
 +
</div>
 +
 
  
 
== year only ==
 
== year only ==
Line 39: Line 46:
 
;ISO8601 syntax
 
;ISO8601 syntax
 
:YYYY-MM
 
:YYYY-MM
 +
;use cases
 +
:Blog/publishing archive pages - see Benward.me, ablognotlimited.com (need specific links to archive pages), http://www.flickr.com/photos/tantek/archives/
 +
:output equivalent of <code>&lt;input type="month"&gt;</code>, see [[Time_element#impedance_match_new_date_time_inputs|impedance match new date time inputs]] above.
  
 
<div class="discussion">
 
<div class="discussion">
Line 50: Line 60:
 
* ...
 
* ...
 
</div>
 
</div>
 +
 +
== year week only  ==
 +
The time element should accept just a year and a week number.
 +
;ISO8601 syntax
 +
:YYYY-WNN
 +
;use case research
 +
:no examples in the wild currently.  If anyone knows of any sites which publish references to specific weeks of a year, either by name / expression (e.g. "first week of the year") or by specific number (e.g. "weeks 1-26"), please provide URLs and quotes of example content.
 +
:output equivalent of <code>&lt;input type="week"&gt;</code>, see [[Time_element#impedance_match_new_date_time_inputs|impedance match new date time inputs]] above.
 +
 +
;reasoning
 +
:to provide the output equivalent of <code>&lt;input type="week"&gt;</code>
 +
 +
See [[Time_element#impedance_match_new_date_time_inputs|impedance match new date time inputs]] above.
 +
 +
<div class="discussion">
 +
Opinions / discussion:
 +
* +1 [[Tantek]] per good design of impedance matching date time inputs.
 +
* ...
 +
</div>
 +
  
 
== month day only ==
 
== month day only ==

Revision as of 20:57, 5 August 2010

Research, data, use cases, issues, and enhancements related to the HTML5 time element.

impedance match new date time inputs

The time element should be able to represent every granularity of times and dates that the new date time <input> elements allow. Here is a list of all the date time <input> elements along with the corresponding <time> element usage (if applicable)

<input type="date">           - <time>YYYY-MM-DD</time>
<input type="datetime">       - <time>YYYY-MM-DDTHH:MM:SS</time>
<input type="month">          - not supported in current time element
<input type="week">           - not supported in current time element
<input type="time">           - <time>HH:MM:SS</time>
<input type="datetime-local"> - <time>HH:MM:SS-ZZ:YY</time>

In particular the <time> element is missing support for the following date inputs:

Opinions / discussion:


year only

The time element should accept just a year.

ISO8601 syntax
YYYY
use case research
http://microformats.org/wiki/birthday-examples#year_only

Opinions / discussion:

year month only

The time element should accept just a year and a month.

ISO8601 syntax
YYYY-MM
use cases
Blog/publishing archive pages - see Benward.me, ablognotlimited.com (need specific links to archive pages), http://www.flickr.com/photos/tantek/archives/
output equivalent of <input type="month">, see impedance match new date time inputs above.

Opinions / discussion:

year week only

The time element should accept just a year and a week number.

ISO8601 syntax
YYYY-WNN
use case research
no examples in the wild currently. If anyone knows of any sites which publish references to specific weeks of a year, either by name / expression (e.g. "first week of the year") or by specific number (e.g. "weeks 1-26"), please provide URLs and quotes of example content.
output equivalent of <input type="week">, see impedance match new date time inputs above.
reasoning
to provide the output equivalent of <input type="week">

See impedance match new date time inputs above.

Opinions / discussion:

  • +1 Tantek per good design of impedance matching date time inputs.
  • ...


month day only

The time element should accept just a month and a day.

ISO8601 syntax
--MM-DD
use case research
http://microformats.org/wiki/birthday-examples#month_and_day_only

Opinions / discussion:

Calendar

The time element should accept a calendar scale (CALSCALE; default is GREGORIAN) per (and to facilitate interoperability with) the emergent vCard 4 specification, to allow for the the mark-up of non-Gregorian (e.g. Julian) dates, using some as-yet-to-be-formulated CALSCALE type.

Opinions / discussion:

  • +1 Andy Mabbett (Per use cases in VCARDDAV, EDTF & TEI - see external links)

Fuzzy dates

The time element should accept fuzzy (uncertain, approximate) dates ("summer 1970", "circa December 1963", "flourished 1580") and eras ("Edwardian", "bronze age", "Jurassic")".

Opinions / discussion:

Specification ambiguities

The specification requires that time be expressed as UTC (or another time zone with a specified offset from UTC). However, the representation of leap seconds is not specified. Further, the algorithms to convert between string and number are flawed, because the number is described as "number of milliseconds elapsed from midnight UTC on the morning of 1970-01-01" but the actual number of milliseconds includes all kinds of strange decisecond offsets during the period 1961-01-01 to 1972-01-01. Also, UTC did not exist before about 1960.

Unix timekeeping has a long history of terrible definitions, and Unix notions of time should be totally rejected and expunged.

Choose different default date

The statement that valueAsDate IDL attribute should return the value 1970-01-01 plus the appropriate time when the time element contains no date creates a problem that there are likely to be time elements that explicitly contain that date.

A better choice would be a value that is highly unlikely to be encountered, and would be implausible as an actual date in most applications, perhaps 9999-12-31.

Tag

Blog posts, Twitter updates etc. may be tagged HTML5time or #HTML5time

External links

Prior discussion

Resources