| Issue 356: | javascript events collection date problem (wrong month; for all month eg: january='00' instead '01') | |
| 1 person starred this issue and may be notified of changes. | Back to list |
If I use the following Javascript-Snippet:
events: [
{title:"test",start: new Date('2010','02','10')}
]
I dont get an event on the 10. January 2010. Instead I get an event for the
10. February 2010.
So I corrected the code like this:
events: [
{title:"test",start: new Date('2010','02'-1,'10')}
]
I decreased the month by one.
Is that correct so ?
|
|
| ► Sign in to add a comment |
first, don't use strings like '2010', just use the integer literal 2010. 2nd, the date object's month parameter is ZERO-based, so 0=jan, feb=1 if you want an event on January 10th, do this... events: [ {title:"test",start: new Date(2010,0,10)} ]Labels: -Type-Defect Type-Question