]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #5594
authorJonatan Kronqvist <jonatan.kronqvist@itmill.com>
Tue, 14 Sep 2010 10:36:25 +0000 (10:36 +0000)
committerJonatan Kronqvist <jonatan.kronqvist@itmill.com>
Tue, 14 Sep 2010 10:36:25 +0000 (10:36 +0000)
svn changeset:14896/svn branch:6.4

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

index 0ca28481d1e83b1b4fe08fcfbc390be0ed98a206..156e6ff5efca0341945520853d51ddd5830f9a30 100644 (file)
@@ -262,17 +262,19 @@ public class VCalendarPanel extends FocusableFlexTable implements
     private void selectFocused() {\r
         if (focusedDate != null) {\r
             int changedFields = 0;\r
-            if (value.getYear() != focusedDate.getYear()) {\r
-                value.setYear(focusedDate.getYear());\r
-                changedFields += VDateField.RESOLUTION_YEAR;\r
+            // #5594 First set the day, to make sure that moving from the 31 on\r
+            // to a month with 30 days to spill over to the wrong month.\r
+            if (value.getDate() != focusedDate.getDate()) {\r
+                value.setDate(focusedDate.getDate());\r
+                changedFields += VDateField.RESOLUTION_DAY;\r
             }\r
             if (value.getMonth() != focusedDate.getMonth()) {\r
                 value.setMonth(focusedDate.getMonth());\r
                 changedFields += VDateField.RESOLUTION_MONTH;\r
             }\r
-            if (value.getDate() != focusedDate.getDate()) {\r
-                value.setDate(focusedDate.getDate());\r
-                changedFields += VDateField.RESOLUTION_DAY;\r
+            if (value.getYear() != focusedDate.getYear()) {\r
+                value.setYear(focusedDate.getYear());\r
+                changedFields += VDateField.RESOLUTION_YEAR;\r
             }\r
 \r
             selectDate(focusedDate.getDate());\r