I’ve created a little script for displaying a calendar but the month is 1 digit out. EG June displays 5 instead of 6.
take a look here: http://jsfiddle.net/jwoodcreative/vgTN7/
What am I doing wrong…?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In JavaScript months start from 0. Just add 1 to it. From the MDN article (emphasis added):
This is defined in the ECMAScript specification:
Here’s an updated fiddle.