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