diff options
author | Grim <mirgantrophy@users.noreply.github.com> | 2017-08-09 08:43:07 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-08-09 11:43:07 +0300 |
commit | 0c993377de46dbe89909f1f1cab06d3851e90851 (patch) | |
tree | b7fd14271cd815d8f7f7d85fc11fa6063e1174aa /uitest | |
parent | 69fb1c9895298da6f45cc00763515944aeb9c22d (diff) | |
download | vaadin-framework-0c993377de46dbe89909f1f1cab06d3851e90851.tar.gz vaadin-framework-0c993377de46dbe89909f1f1cab06d3851e90851.zip |
Re(set) calendar time after calculating rollAmount (#9479)
by calling calendar.setTime(today);
after rollAmount has been initialized and given a value, we can reset the calendar's internal time back to the correct date. As it is currently implemented; calling calendar.getTime() will result in a wrong date, it returns the first of the month with the correct time.
The function addInitialEvents() is called AFTER the calendar's time has been subtracted from (by calculating the rollAmount), as such this results in an incorrect internal time and the 'Day' button does not switch to the correct day. Instead it shows the first of the month here too.
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java index 59f71cbbca..6155be7f93 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java @@ -580,6 +580,7 @@ public class CalendarTest extends GridLayout implements View { int rollAmount = calendar.get(GregorianCalendar.DAY_OF_MONTH) - 1; calendar.add(GregorianCalendar.DAY_OF_MONTH, -rollAmount); currentMonthsFirstDate = calendar.getTime(); + calendar.setTime(today); updateCaptionLabel(); |