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 Chat (such as one of these permanent autoconfirmed members).

Time element: Difference between revisions

From WHATWG Wiki
Jump to navigation Jump to search
(started documenting impedance match with input work)
(→‎External links: + another mailing list thread)
Line 91: Line 91:
** [http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-February/018639.html whatwg mailing list discussion of the above, Feb 2009]
** [http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-February/018639.html whatwg mailing list discussion of the above, Feb 2009]
** [http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-March/018685.html further whatwg mailing list discussion of the above, Mar 2009]
** [http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-March/018685.html further whatwg mailing list discussion of the above, Mar 2009]
*** [http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-March/018888.html Spec editor's  response and further discussion, late Mar 2009]
* [http://html5doctor.com/the-time-element/ HTML5 Doctor: The Time Element]
* [http://html5doctor.com/the-time-element/ HTML5 Doctor: The Time Element]
* [http://tools.ietf.org/html/draft-ietf-vcarddav-vcardrev-11 vCard Format Specification draft-ietf-vcarddav-vcardrev-11] (latest draft as at July 2010)
* [http://tools.ietf.org/html/draft-ietf-vcarddav-vcardrev-11 vCard Format Specification draft-ietf-vcarddav-vcardrev-11] (latest draft as at July 2010)

Revision as of 09:40, 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 inputs allow. In particular:

  • 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>

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

Opinions / discussion:

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 and eras.

Opinions / discussion:

  • +1 Andy Mabbett (Per use cases in "Extended Date Time Format" proposals & TEI - see external links)
  • ...

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.

External links