summaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
authorOlli Helttula <olli@vaadin.com>2014-02-07 13:07:45 +0200
committerVaadin Code Review <review@vaadin.com>2014-02-13 08:48:39 +0000
commit3b327f6131166d3b503a55b7e91b853d179a3595 (patch)
tree2d2ac85fbc637513048d2337731ed2377f14bee3 /client/src
parentb008768b93c9dcd73272012e2628ea2074c42b32 (diff)
downloadvaadin-framework-3b327f6131166d3b503a55b7e91b853d179a3595.tar.gz
vaadin-framework-3b327f6131166d3b503a55b7e91b853d179a3595.zip
Change copying of Date values to avoid wrapping of date (#13269)
The error occurs only when current day is in the end of the month and the textfield has no value when choosing months in the CalendarPanel. This can not be sensibly tested by automated tests as it would require setting the server time to a date that would trigger the problem (for example 30.1). The error does not occur if the value is set before setting the resolution (by the user or programmatically). Change-Id: I6b3e5b699a773bd84b0f756d0c53698a09854a81
Diffstat (limited to 'client/src')
-rw-r--r--client/src/com/vaadin/client/ui/VCalendarPanel.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/client/src/com/vaadin/client/ui/VCalendarPanel.java b/client/src/com/vaadin/client/ui/VCalendarPanel.java
index 96678fd133..e584a21563 100644
--- a/client/src/com/vaadin/client/ui/VCalendarPanel.java
+++ b/client/src/com/vaadin/client/ui/VCalendarPanel.java
@@ -892,9 +892,8 @@ public class VCalendarPanel extends FocusableFlexTable implements
if (!isDateInsideRange(requestedNextMonthDate, Resolution.DAY)) {
requestedNextMonthDate = adjustDateToFitInsideRange(requestedNextMonthDate);
}
- focusedDate.setYear(requestedNextMonthDate.getYear());
- focusedDate.setMonth(requestedNextMonthDate.getMonth());
- focusedDate.setDate(requestedNextMonthDate.getDate());
+
+ focusedDate.setTime(requestedNextMonthDate.getTime());
displayedMonth.setMonth(displayedMonth.getMonth() + 1);
renderCalendar();
@@ -949,9 +948,7 @@ public class VCalendarPanel extends FocusableFlexTable implements
if (!isDateInsideRange(requestedPreviousMonthDate, Resolution.DAY)) {
requestedPreviousMonthDate = adjustDateToFitInsideRange(requestedPreviousMonthDate);
}
- focusedDate.setYear(requestedPreviousMonthDate.getYear());
- focusedDate.setMonth(requestedPreviousMonthDate.getMonth());
- focusedDate.setDate(requestedPreviousMonthDate.getDate());
+ focusedDate.setTime(requestedPreviousMonthDate.getTime());
displayedMonth.setMonth(displayedMonth.getMonth() - 1);
renderCalendar();