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

Bronislav Klučka Bronislav.Klucka at bauglir.com
Wed Jan 30 13:24:26 PST 2013

On 30.1.2013 21:55, Mounir Lamouri wrote:
> Hi,
> In my war against useless input types, I had a look at 'month' and
> 'week' and I am wondering what was the rationale behind having them in
> the HTML specifications.
> Regarding 'month', I mostly don't understand the use case. I can't find
> any situation where I am asked to input a { month, year } information.
> Given that the element is pretty trivial to implement by authors (this
> is basically two <select> or a select and a <input type='number'>), the
> only advantage I see to have this element in the specifications is to
> have a native UI on mobile.
> I am wondering if use cases were taken into account when this was added
> to the specs and if vendors that implement this element can report good
> adoption if any.
> I can see niche use cases for 'week' but I do not think it is easy to
> come up with a good UI for this, especially on mobile (there is no
> native UI on mobile AFAIK). On desktop, Chrome's UI is terrible but the
> Opera one is decent.
> This type would solve the use cases of people trying to find a week to
> meet. Typically, W3C F2F's. However, this is a niche use cases. Most of
> the times, when people speak in 'week', they don't really mean from
> Monday to Sunday. For example, if someone takes a vacation "the first
> week of February", he/she will not book its hotel for the week 5 or 6
> but from a specific day to another specific day.
> Generally speaking, I believe both those types lack use cases and I
> wonder if the HTML specifications are not defining a solution for
> something that is still looking for its problem.
> In other words, are authors writing their own 'month' and 'week' widget
> at the moment? If they are, would there life be easier with those input
> types?
> Thanks,
> --
> Mounir

You really cannot find any usecase?
I use Chrome's week and month (and other) regularly...
month data: events within a month, articles published in given month, 
users registered in given month, money spent in selected month...
week span: I do not want my users to count what is the monday 3 weeks 
from now or have to select 2 days when all they want to say is exactly 1 
the same goes for other types other combinations.

sure user can select a day within week or within month...
1/ that is confusing, if user chooses november 2013 I want user to see 
november 2013, not 8th november 2013
2/ app would have to determin the boudaries, extract month or compute 
which week is it (e.g. if I have week statistics computed I have data 
for 31W2013 as a one identifier)


More information about the whatwg mailing list