datetime input (was: Re: [whatwg] Web Forms 2.0 comments)

Ian Hickson ian at
Wed Jun 30 15:48:01 PDT 2004

On Wed, 30 Jun 2004, Sander wrote:
> Thinking about datetime input values (as they currently exist) while
> writing this email, I have realized that the zero-point for step is
> currently undefined for all datetime-related input types (well, the spec
> says it's "0", but I call that undefined). For time it's reasonable
> enough to put this as "00:00:00", but date is harder. (0? 1900? 1981?
> the current year? (And if so, the current day? Current time?)) This will
> need to be specified in any case. (Alternatively it might be easier to
> specify a default "min" value.)

Good point. What value do people prefer? Midnight on Thursday January 1st
1970? (the zero point for time_t) I've used that for now. It's arbitrary,
but better than 0000-01-01, since then you might have to take into account
the start of the gregorian calendar and all that nonsense.

>> The problem is that with your solution, UAs have to be able to work out
>> how to render the UI of thinks like "d,h,m,15w". I have no idea how that
>> would look, let alone how a UA would handle it or how to specify it in
>> the spec.
> Assuming that the order of the fields specified can be ignored by the
> useragent and just treated as largest first (a reasonable enough assumption
> I think)

Is it? People were asking to be able to format their fields.

> plus assuming that you meant w for week of the year, and m for minute
> (various languages use different conventions, so here I went for the
> easiest one) :), I think it would look roughly the same as <input
> type="local-datetime" step="9072000">, except without a year identifier.

But the concept of "week" is meaningless without a year. So is day, for
that matter.

> Are there any other people with feelings about this? Am I the only one
> who believes that a lot of situations will be encountered where the six
> datetime types currently available will prove to be too limited, and
> that I'd really prefer one type="datetime" capable of handling it all?

I've been looking around the Web, and while I agree there are edge cases
that aren't dealt with, I don't think they are common enough to require
the extra complexity that you are proposing.

>> For a dropdown to pick a month, there is nothing wrong with <select>
>> with twelve child <option> elements.
> Indeed. And yet, if it's all the same to you, I'd much rather write <input
> type="datetime" format="m"> then the 14 lines for the select; particularly
> as I can just see the client for that site coming back a few months later
> with a request to increase the specificity to week. 52 lines of "jan 01 -
> 07" don't make me happy, where <input type="datetime" format="w"> does. :)

<input type="week"> is even easier. :-)

Ian Hickson               U+1047E                )\._.,--....,'``.    fL       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list