jijo-paulose / gwt-cal

Automatically exported from code.google.com/p/gwt-cal
0 stars 0 forks source link

Hour difference in TimeBlockClickEvent #144

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
To get the hour difference
1. Scroll the calendarView to the bottom
2. Click on a TimeBlock, to generate TimeBlockClickEvent

To resolve the hour difference:
1. Scroll to top
2. Click timeBlock

What is the expected output? What do you see instead?
After scrolling to the bottom al TimeBlockEvents are an hour early, in 
comparison with the visually clicked TimeBlock

Scrolling back to the top makes them in sync again, but this isn't really 
workable.

gwt-cal version?
Using the latest 0.9.3 build

Original issue reported on code.google.com by a.wiek...@gmail.com on 4 Jan 2012 at 12:00

GoogleCodeExporter commented 8 years ago
I was also running into issues with TimeBlockClickEvents giving different 
target dates than expected, which may be related. This occurred when the window 
was scrolled vertically. I fixed the issue (using code from version 427), at 
least for my configuration, by changing DayView.onSingleClick()'s
int y = DOM.eventGetClientY(event);
to
int y = DOM.eventGetClientY(event)+Window.getScrollTop();

Original comment by Willia...@gmail.com on 7 Sep 2012 at 6:02

GoogleCodeExporter commented 8 years ago
Same problem when the window was scrolled horizontally.
Another way to fix it. Changing DayView.timeBlockClick()
        int relativeY = y - top + scrollOffset;
        int relativeX = x - left;
to 
        int relativeY = y - top + scrollOffset + Window.getScrollTop();
        int relativeX = x - left + Window.getScrollLeft();

Original comment by dom....@gmail.com on 8 Sep 2012 at 6:16

GoogleCodeExporter commented 8 years ago
I cannot replicate using the latest 0.94-SNAPSHOT trunk code.

Can any of you try it? If you can replicate, can you provide some code example 
to replicate? Maybe a patch with the needed changes to the gwt-cal-demo code.

Thanks

Original comment by ctasada on 15 Sep 2012 at 8:42

GoogleCodeExporter commented 8 years ago
Fixed in r431.

To replicate was needed to remove the autosizing from the get-cal-demo code and 
increase the calendar's height

Original comment by ctasada on 10 Oct 2012 at 10:34