[whatwg] datalist @exclusive

Jukka K. Korpela jkorpela at cs.tut.fi
Wed Mar 9 06:28:00 PST 2011


Christoph Päper wrote:

> Diogo Resende:
>>
>> I was thinking.. what about allowing big time spans, like: from
>> April 1st to June 30th? Giving that the date has "-" as date element
>> separators we could not use YYYY1-MM1-DD1-YYYY2-MM2-DD2.
>
> ISO 8601 specifies how to code time intervals (and durations) in
> several ways: start and end date/time, start date/time and duration,
> duration and end date/time, or duration only – the separtor alwas is
> a forward slash ‘/’, replacable by a double hyphen ‘--’ if necessary.
>
> If HTML was to support this it should do so in compatibility with ISO
> 8601.

Setting a date range limitation is already possible according to the current 
version of HTML5 drafts, just not as an ISO 8601 range notation (which 
nobody uses outside laboratories and which requires parsing the limits) but 
with min and max attributes, e.g.
<input type="date" min="2011-04-01" max="2011-06-30">

Ref.: 
http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#date-state

This is supported both by Opera (in its calendar widget) and by Chrome (in 
its somewhat odd widget that lets you scroll through dates, one date at a 
time, but I think that's meant to be allowed as conforming).

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 



More information about the whatwg mailing list