[Javascript] chopping up a string?
Walter Torres
walter at torres.ws
Mon Nov 17 09:27:12 CST 2003
> -----Original Message-----
> From: javascript-bounces at LaTech.edu
> [mailto:javascript-bounces at LaTech.edu]On Behalf Of Paul McGuire
> Sent: Monday, November 17, 2003 9:12 AM
> To: [JavaScript List]
> Subject: Re: [Javascript] chopping up a string?
>
>
> It is as the field looses focus I have been working on this all day and my
> solution (which is still theory) is
your theory works as well as mine.
The only thing I would change...
> i.e
>
> current date is 17/11/03
>
> oursatestring is 17/11/
>
> strip the 6 characters off current date to leave 03
>
> 17/11/ + 03
Why waste energy stripping the year off?
just use... getYear()
This will return a 2 digit year for you.
> and there you have it the date in a variable created from the
> numbers added into the reqdate box.
Yep. Works fine.
Folks can quibble about style, but what you have sounds fine to me.
I image others will chime in with their version.
Good luck.
Walter
More information about the Javascript
mailing list