maggieraff / jmonthcalendar

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

Day repeating #44

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Go to month October
2. See an day repeating
3. 15/10/20XX or 16/10/20XX

What is the expected output? What do you see instead?
-

What version of the product are you using? On what operating system?
I see this in the version 1.3.0 and 1.3.1

Please provide any additional information below.

Original issue reported on code.google.com by jhoma...@gmail.com on 20 Dec 2010 at 4:02

GoogleCodeExporter commented 9 years ago
I managed to fix the bug, but the events are gone.

I changed this line:
 _workingDate = new Date(today.getFullYear(), today.getMonth(), 1);

To this:
_workingDate = new Date(today.getFullYear(), today.getMonth(), 1, 4);

Help?

Original comment by jhoma...@gmail.com on 21 Dec 2010 at 6:25

GoogleCodeExporter commented 9 years ago
The problem is related Daylight Saving

Original comment by jhoma...@gmail.com on 21 Dec 2010 at 6:27

GoogleCodeExporter commented 9 years ago
The same logic probably needs to be added for the events.  I will take a look 
at it tonight hopefully.

Original comment by k.leneau@gmail.com on 21 Dec 2010 at 6:42

GoogleCodeExporter commented 9 years ago
OK, I'm waiting.

Original comment by jhoma...@gmail.com on 21 Dec 2010 at 9:54

GoogleCodeExporter commented 9 years ago
What part do I have to change for events to work properly?

Original comment by jhoma...@gmail.com on 22 Dec 2010 at 5:17

GoogleCodeExporter commented 9 years ago
Hi any update on this bug? I might have a fix - but don't want to debug too 
long if it's been fixed, but not yet committed.

Charlie

Original comment by supp...@neptuneweb.com on 20 Jan 2011 at 2:27

GoogleCodeExporter commented 9 years ago
scripts/jMonthCalendar.js:  

Here's a fix that worked for me.

/* below these 2 (existing) lines */
var startI = new TimeSpan(tempStartDT - _dateRange.startDate).days;
var endI = new TimeSpan(tempEndDT - _dateRange.startDate).days;

/* ... add ... */

/* if daylight savings time changes between the start and end date, adjust for 
that. */
 var sTimeSpanOffset = tempStartDT.getTimezoneOffset() - _dateRange.startDate.getTimezoneOffset();
                                /* calculate the difference between timezoneOffsets to see if DST started in the duration */
                                var eTimeSpanOffset = tempEndDT.getTimezoneOffset() - _dateRange.startDate.getTimezoneOffset();

 /* since we only deal with full days, adjust accordingly by incrementing box, which would otherwise be too low if time was "removed" due to DST change. The right place for this may be within the TimeSpan function, though it's hard to say. I assume this problem isn't happening when time is added, but I'll wait 'till Sept/Oct. to find out. */                                                                                    if (sTimeSpanOffset < 0) {                                                                                                                                                  startI++;                                                                                                                                                   }                                                                                    if (eTimeSpanOffset < 0) {                                                                                                                                                  endI++;                                                                              }

Neptune Web, Inc. Support

Original comment by supp...@neptuneweb.com on 20 Jan 2011 at 5:15

GoogleCodeExporter commented 9 years ago
Thanks for the fix, works great for me.  Was banging my head against the wall 
on the daylight savings issue for a while.

Original comment by tom.fern...@gmail.com on 22 Jan 2011 at 10:20