igorsoaresassis / jmonthcalendar

Automatically exported from code.google.com/p/jmonthcalendar
Other
0 stars 0 forks source link

Events are offset by one month #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Copied code off your site
2.added these two events
var events = [ { "EventID": 1, "StartDateTime": new Date(2009, 8, 12), 
"EndDateTime": new Date(2009, 8, 14), "Title": "my birthday", "URL": 
"/events/", "Description": "ghjk" }, 
                   { "EventID": 2, "StartDateTime": new Date(2009, 8, 12), 
"EndDateTime": new Date(2009, 8, 14), "Title": "youthled", "URL": 
"/events/", "Description": "ryj" } ]; 
//$.jMonthCalendar.ReplaceEventCollection(events);
3.call Initialize(options, events)

What is the expected output? What do you see instead?
expected the events to show up in the 8'th month, august, instead they 
showed up in the 9th month, september.

What version of the product are you using? On what operating system?
jMonthCalendar 1.3.1-beta

Please provide any additional information below.
NA

Original issue reported on code.google.com by Craig...@gmail.com on 6 Aug 2009 at 9:21

GoogleCodeExporter commented 8 years ago
Javascript has a zero based index for months in the date object.  When you 
expect 
Janurary to be 1 it is actually 0.  All the standard month numbers are 1 less 
so in 
your case if you want an event in August (8th month) you should use 7 because 
Jan is 0 
instead of 1.

Original comment by k.leneau@gmail.com on 6 Aug 2009 at 5:31

GoogleCodeExporter commented 8 years ago
This deals only with the new Date() function.
new Date(2009, 8, 14)
Which renders one month off.

Original comment by bill.fet...@gmail.com on 15 Sep 2009 at 5:53