W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2014

Re: [whatwg] <input type=number> for year input

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Wed, 19 Feb 2014 09:12:46 +0200
Message-ID: <5304596E.3020100@cs.tut.fi>
To: whatwg@lists.whatwg.org
2014-02-19 2:30, Michael[tm] Smith wrote:

> The following info seems relevant -
>
>    http://www.thepunctuationguide.com/comma.html#numbers
>    "Most authorities, including The Associated Press Stylebook and The Chicago
>    Manual of Style, recommend a comma after the first digit of a four-digit
>    number. The exceptions include years, page numbers, and street addresses."

Similar rules apply to other languages as well. Generally, we should 
expect implementations to apply documented locale-specific rules (for 
some locale determined somehow). There are different grouping rules, 
though; not all locales use groups of three digits. Anyway, we should 
expect a 4-digit number to be grouped, with some group separator, rather 
often.

> To me that appears to be a strong argument that formatting of years is in
> fact clearly an exception, and that's compelling enough to warrant having a
> type for them separate from the normal number type (in which four-digit
> numbers would instead have a separator, to follow existing longstanding
> conventions).

And what about page numbers and street addresses (and other exceptions)? 
If we have <input type=year>, then it would be rather odd to use it for 
reading a page number.

Most importantly, though, this would introduce yet another value for the 
type attribute for something that can well be handled with existing 
tools: <input pattern=\d{4}>. It is improbable that any year selection 
widget would be useful. Years are normally best entered by typing them.

On the other hand, as this is about input, not output, a simple 
additional rule (which has other usability benefits, too) would solve 
the issue, too: User agents may allow locale-specific group separators 
in a number (e.g., “1,500” when the locale is English), but they shall 
accept a number without group separators, too (e.g., “1500”, in any locale).

Yucca
Received on Wednesday, 19 February 2014 07:13:14 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:16 UTC