[whatwg] Suggested changes to Web Forms 2.0, 2004-07-01 working

Dean Edwards dean at edwards.name
Fri Jul 9 07:26:51 PDT 2004


> Matthew Raymond wrote
> 
>>   Try searching on "javascript isdate".
> 
Jim Ley wrote:
> nope, still not found one, the one you seem to be talking about is the
> constrained format version, remember I do not believe we can do
> constrained format in legacy UA's, simply because we cannot provide
> the hint on how to do it without confusing WF2 clients.  Therefore we
> have to be able to accept any random content.
> 

i'm looking at an old date validation function of mine now. it handles 
international date formats and it's about 20 lines of code. the function 
was written to a client's specific requirements but it should not be too 
difficult to make sure that it is generic enough for WF2. if size is an 
issue (and i think it should be for a plugin such as this) then there 
are ways to compress javascript code. i just run my "isDate" function 
through my own javascript packer and it came out at about 600 bytes.

as an aside, javascript is pretty good at validating dates. try this 
snippet:
alert(Date.parse("3 Aug 1999"));
cool huh?

-dean





More information about the whatwg mailing list