ArchingCao / jmonthcalendar

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

events not displayed on the calendar #47

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.I have  fetched the event details from the database and converted the events 
array into json object. 
2.After that I have passed the json object to jMonthCalendar.js by using the 
line "$.jMonthCalendar.Initialize(options,jsonobject)".
3.The events should be displayed on the calendar but it is not displaying.

Original issue reported on code.google.com by srjith.1...@gmail.com on 7 Mar 2012 at 12:28

GoogleCodeExporter commented 8 years ago
Eagerly waiting for your reply. 

Original comment by srjith.1...@gmail.com on 7 Mar 2012 at 12:28

GoogleCodeExporter commented 8 years ago
Thanks in advance.

Original comment by srjith.1...@gmail.com on 7 Mar 2012 at 12:29

GoogleCodeExporter commented 8 years ago
This might be a leap year problem. I'm having the same issue and I'm trying to 
track it down now, but it appears that it's going to be a problem with the fact 
that Feb is included in the calendar.

Original comment by ja...@ignitelocalmarketing.com on 15 Mar 2012 at 4:25

GoogleCodeExporter commented 8 years ago
I was wrong (as least for my installation). It was due to the daylight savings 
time.

Basically, Timespan typically reports the number of days from the start of the 
calendar (26 Feb for this month) and the day of the event (say, 15 days). It 
uses that number to grab the box, makes sure that the box is the right date and 
then adds the event. However, with DST, instead of 15 days, timespan returns 14 
days and 23 hours, so the library grabs the wrong date box and ends up not 
adding the event.

No quick fix without tweaking the code. Replacing the startI and endI lines 
(~358) with the following will work:

var startTS = new TimeSpan(tempStartDT - _dateRange.startDate);
                var endTS = new TimeSpan(tempEndDT - _dateRange.startDate);
                var startI = startTS.days + ((startTS.hours == 0) ?  0 : 1);
                var endI = endTS.days + ((endTS.hours == 0) ? 0 : 1);

Original comment by ja...@ignitelocalmarketing.com on 15 Mar 2012 at 5:05

GoogleCodeExporter commented 8 years ago
See issue #48

Original comment by ja...@ignitelocalmarketing.com on 15 Mar 2012 at 5:11