[whatwg] Why do we have <input type='month'> and <input type='week'>?

Tab Atkins Jr. jackalmage at gmail.com
Tue Feb 12 09:26:16 PST 2013


On Tue, Feb 12, 2013 at 9:20 AM, Mounir Lamouri <mounir at lamouri.fr> wrote:
> On 01/02/13 15:39, Glenn Maynard wrote:
>> 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.

The fact that authors today have a random assortment of displays for
the exact same feature (credit card expirys) is something that would
be great to fix, not bemoan as a loss to the world. ^_^

~TJ



More information about the whatwg mailing list