diff options
author | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-01-27 15:20:55 +0000 |
---|---|---|
committer | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-01-27 15:20:55 +0000 |
commit | 0298d4038185cf2d4113cd3d77f75d48670b6fdd (patch) | |
tree | 3db4f0849db76d29ec918813a9d1807fc05cb93b /src | |
parent | 4309b3adadd66756db910e45b9e1c14d0d3b9b2a (diff) | |
download | vaadin-framework-0298d4038185cf2d4113cd3d77f75d48670b6fdd.tar.gz vaadin-framework-0298d4038185cf2d4113cd3d77f75d48670b6fdd.zip |
#6718 Fixed an off-by-one bug; use displayedMonth consistently
svn changeset:22802/svn branch:6.8
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java index a2f03d6176..eb1a742db9 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java @@ -481,11 +481,11 @@ public class VCalendarPanel extends FocusableFlexTable implements tmp.getDate()); final int startWeekDay = getDateTimeService().getStartWeekDay( - focusedDate); - final Date curr = (Date) focusedDate.clone(); + displayedMonth); + final Date curr = (Date) displayedMonth.clone(); // Start from the first day of the week that at least partially belongs // to the current month - curr.setDate(-startWeekDay); + curr.setDate(1 - startWeekDay); // No month has more than 6 weeks so 6 is a safe maximum for rows. for (int weekOfMonth = 1; weekOfMonth < 7; weekOfMonth++) { @@ -508,7 +508,7 @@ public class VCalendarPanel extends FocusableFlexTable implements day.addStyleDependentName(CN_FOCUSED); } } - if (curr.getMonth() != focusedDate.getMonth()) { + if (curr.getMonth() != displayedMonth.getMonth()) { day.addStyleDependentName(CN_OFFMONTH); } |