[whatwg] Re: Proposal: datesubmissionformat (repost)
malcolm-what at farside.org.uk
Thu Jul 22 05:25:42 PDT 2004
Lachlan Hunt writes:
>> [converting a date control that accepts 'dd/mm/yyyy' to a WF2 'date'
> Why couldn't they just change the hint to a different format?
> <label>Enter date of visit as YYYY-MM-DD:
> <input type="date" ... ></label>
They could, and I probably should have mentioned that. They would still need
to change the server-side processing to parse a date in that format,
however, and (possibly more significantly) they would then be requiring
users to enter dates in a 'foreign' format. For a site with a sufficiently
savvy or international audience, that's unlikely to be a problem (for
example, both Bugzilla and Bonsai request dates in ISO format), but for a
small site designed to serve 'local' customers only, requiring an ISO format
is likely to be perceived as particularly unfriendly.
My key point is this, I suppose: All of the other (commonly-used) input
types are directly backward-compatible with existing practice, which allows
a seamless upgrade to WF2 controls. All, that is, except for 'date'. Can we
improve 'date' so that existing sites can upgrade with minimal effort?
>> Critically, I am not proposing a general-purpose format specifier; the
>> allowed values for this attribute would be drawn from a short list of
>> 'common' date formats. The ones I had in mind were "iso" (for ISO8601,
>> the default, yyyy-mm-dd), "d/m/y" (UK format, dd/mm/yyyy), "m/d/y" (US
>> format, mm/dd/yyyy), and probably a 'European' format "d.m.y"
> If there was going to be a date format attribute, then I would insist
> that it accepts strings using the same letter convention as in the
> ISO8601 spec.
I think that's a very bad idea, for the reasons I mentioned in my original
email. However ...
> [..] I think attempting to restrict it to a list
> of predefined formats wouldn't work anyway, because authors don't always
> read the specs, so many would just guess and think they could enter it
> however they like.
... I think that's a very persuasive argument. My alternative was to used
named formats ('ISO', 'US', 'UK', 'Europe', though I wasn't particularly
happy with the choice of names). Is that better?
More information about the whatwg