View Single Post
Old 01-18-2013, 08:49 AM   PM User | #5
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,532
Thanks: 0
Thanked 503 Times in 494 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
There's only one thing really wrong with the original code:

Quote:
Originally Posted by pilsnermonkey View Post
Code:
d.setDate(0);
This sets the date to the last day of the previous month (why you were getting December instead of January) - to set to the last day of the current month you'd need to add 1 to the month as well.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Users who have thanked felgall for this post:
pilsnermonkey (01-19-2013)