[Herts] LUG date javascript quick fix

James Ronan james at ronanweb.co.uk
Thu Nov 1 18:04:13 GMT 2007


Hi Kevin,

True, but it believed that Oct was 9 and Dec was 10 ?

It has to be something to do with the way it adds a month, a rounding error
or some such as its now working correctly. I guess it was because it was on
the 31st.

Dunno ..... ??


Kevin Parkes wrote:
> It's because JS numbers in a C-like style - January is month 0, December is
> month 11.
> 
> 	Kevin
> 
> -----Original Message-----
> From: herts-bounces at mailman.lug.org.uk
> [mailto:herts-bounces at mailman.lug.org.uk]On Behalf Of James Ronan
> Sent: 31 October 2007 19:28
> To: herts at mailman.lug.org.uk
> Subject: Re: [Herts] LUG date javascript quick fix
> 
> 
> Hi Rob, All  . . .
> 
> <snipped />
>> There is a demo here
>> http://www.jumpstation.co.uk/misc/jsdat.html
> 
> There's a small issue with your JS, in that its giving the date for
> the December meet, not the Nov one. . . .
> 
> I took a look and the date function does indeed add one to the month
> value but for some reason it believes the result is December??
> 
> Is this just me? Or is it a weird issue with the JS date object on
> the 31st of the month.
> 
> Cheers,
> JamesR
> 
> 
> _______________________________________________
> Herts mailing list
> Herts at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/herts
> 
> 
> _______________________________________________
> Herts mailing list
> Herts at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/herts
> 



More information about the Herts mailing list