]> source.dussan.org Git - vaadin-framework.git/commitdiff
#6718 Fixed a regression: displayedMonth must be in sync with focusedDate
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Tue, 31 Jan 2012 12:10:56 +0000 (12:10 +0000)
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Tue, 31 Jan 2012 12:10:56 +0000 (12:10 +0000)
svn changeset:22839/svn branch:6.8

src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java

index eb1a742db9bb78cf9da4d244fde52ff5c1d81201..5420a2df658a1a6ea2f280df9518d9e272353f92 100644 (file)
@@ -547,7 +547,10 @@ public class VCalendarPanel extends FocusableFlexTable implements
      */
     public void renderCalendar() {
         if (focusedDate == null) {
-            focusedDate = new Date();
+            Date now = new Date();
+            // focusedDate must have zero hours, mins, secs, millisecs
+            focusedDate = new Date(now.getYear(), now.getMonth(), now.getDate());
+            displayedMonth = new Date(now.getYear(), now.getMonth(), 1);
         }
 
         if (getResolution() <= VDateField.RESOLUTION_MONTH