This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12902 - Simplify input types (remove excessive date types) and add format attribute
Summary: Simplify input types (remove excessive date types) and add format attribute
Status: RESOLVED NEEDSINFO
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-07 14:14 UTC by rasamassen
Modified: 2011-10-25 05:09 UTC (History)
5 users (show)

See Also:


Attachments

Description rasamassen 2011-06-07 14:14:16 UTC
Numerous developers are not understanding this number of date types an input can have and their control over the format.  Developers want a clear way to control the format of the date (like if displaying time, the ability to control whether it uses am/pm or allows milliseconds).  Moreover, people want to be able to control the color format and the number format as well.  I, personally, don't like the way I feel constrained by these new input types, particularly limited to having to create an extra radio if I want to display am/pm for languages that naturally expect am/pm over a 24hour clock.

Propose: Remove all datetime types except "datetime".  Add an attribute called "format" which applies to "color", "number" and "datetime" OR use the pattern attribute to achieve format functionality (these three types would have a limited set of formats/patterns like those proposed below rather than regex patterns, with datetime possibly having pattern options like PHP or like Java for simplicity, or use Microsoft's descriptions http://msdn.microsoft.com/en-us/library/az4se3k1.aspx).

Examples:
<input type="color" format="hex"> #000000
<input type="color" format="rgba"> 255, 0, 0, 0.2
<input type="color" format="hsl"> 120, 50%, 50%
<input type="number" format="integer"> 1234
<input type="number" format="float" lang="fr"> 1 234,845
<input type="number" format="decimal(2)"> 1234.84 (only allows 2 decimal precision)
<input type="datetime" format="longdate"> Friday, September 12, 1980 ()
<input type="datetime" format="shortdate" lang="en-GB"> 21/09/1980
Comment 1 Aryeh Gregor 2011-06-07 22:31:34 UTC
(In reply to comment #0)
> Numerous developers are not understanding this number of date types an input
> can have and their control over the format.  Developers want a clear way to
> control the format of the date (like if displaying time, the ability to control
> whether it uses am/pm or allows milliseconds).  Moreover, people want to be
> able to control the color format and the number format as well.

Evidence would be appropriate when making statements like "Numerous developers are . . .", "Developers want . . .", "people want . . .".

> Propose: Remove all datetime types except "datetime".

Why?

> <input type="color" format="hex"> #000000
> <input type="color" format="rgba"> 255, 0, 0, 0.2
> <input type="color" format="hsl"> 120, 50%, 50%

<input type=color> is supposed to pop up a color-picker, not allow manual entry of the color.  What is this format field supposed to do?

> <input type="number" format="integer"> 1234
> <input type="number" format="float" lang="fr"> 1 234,845
> <input type="number" format="decimal(2)"> 1234.84 (only allows 2 decimal
> precision)

These are equivalent to

<input type=number>
<input type=number step=any lang=fr>
<input type=number step=0.01>

No browser yet implements this properly.

> <input type="datetime" format="longdate"> Friday, September 12, 1980 ()
> <input type="datetime" format="shortdate" lang="en-GB"> 21/09/1980

<input type=datetime> and friends are supposed to pop up date-pickers, not allow manual entries of date strings.  (Look at how Opera implements it, for instance.)  What is this format field supposed to do?
Comment 2 Aryeh Gregor 2011-06-24 21:01:14 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the Editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this document:

   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Additional Information Needed
Change Description: no spec change
Rationale: See comment #1.  If you would like any of these changes made, please answer the questions and reopen the bug.  You need to provide a lot more detail about what these attributes are meant to do and why they're needed for the bug to be actionable.
Comment 3 Michael[tm] Smith 2011-08-04 05:02:01 UTC
mass-moved component to LC1