[whatwg] Why do we have <input type='month'> and <input type='week'>?
mounir at lamouri.fr
Tue Feb 12 09:20:49 PST 2013
On 01/02/13 15:39, Glenn Maynard wrote:
> On Thu, Jan 31, 2013 at 6:20 AM, Bruce Lawson <brucel at opera.com> wrote:
>> The use-case for an input type I imagine is that a browser can have a
>> select-like UI (Jan, Feb, March, April ...) which, in a French language
>> browser becomes "Janvier, Fevrier, Mars, Avril .. " (or even Vendémiaire to
>> Fructidor for FRC fans).
> FYI, I would find this annoying. CC expiry entry forms are typically
> select boxes containing 01-12. The text lines up with what's on my credit
> card, so I don't have to translate "07" to "July" in my head when entering
> it off of my card. Any month picker for credit card expiry dates should
> always have month numbers (of course, names *in addition* to numbers are
> fine, though probably pointless).
That's exactly why I think the use case is weak: it is easy to implement
a month picker:
<select name='month'><!--fill with option for each
month--></select><select name='year'><!-- fill with option for each year
you want to show --></select>
Given how easy it is, authors might quickly end up expecting specific
behaviour that the UAs do not provide. For example, Having "01 -
January" or "January - 01" or even "01" instead of "January". They could
want the year to show up as 2 digits or 1 digit, as a textfield, a
<select> or an <input type='number'> with a min and a max.
Anyway, I still believe that the pros of <input type='month'> are quite
low but in another hand, it shouldn't cost too much for UA to implement
it if or date-time-related types are already implemented and it provides
a real benefit on Mobile.
Regarding week, I still believe that the use cases are pretty weak but
the most important issue is that there is no good UI for this on Mobile
More information about the whatwg