diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-12-29 16:20:13 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-12-29 16:20:13 +0000 |
commit | b584f16714c245c0e621843f42883fa460aa87f4 (patch) | |
tree | 8579c6ba18ba6d61ff1530f669848017222b8894 | |
parent | 81c1c5c40977bac334b37b50be7c2c1febfea1fe (diff) | |
download | vaadin-framework-b584f16714c245c0e621843f42883fa460aa87f4.tar.gz vaadin-framework-b584f16714c245c0e621843f42883fa460aa87f4.zip |
fixes #6211
svn changeset:16713/svn branch:6.5
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java | 5 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java index 8c9dba87d2..a14e52d1e6 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java @@ -62,6 +62,11 @@ public class VDateFieldCalendar extends VDateField { calendarPanel.setTimeChangeListener(new TimeChangeListener() {
public void changed(int hour, int min, int sec, int msec) {
Date d = getDate();
+ if (d == null) {
+ // date currently null, use the value from calendarPanel
+ // (~ client time at the init of the widget)
+ d = (Date) calendarPanel.getDate().clone();
+ }
d.setHours(hour);
d.setMinutes(min);
d.setSeconds(sec);
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java index 9b1471b0e3..31e1824706 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java @@ -189,6 +189,11 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, calendar.setTimeChangeListener(new TimeChangeListener() {
public void changed(int hour, int min, int sec, int msec) {
Date d = getDate();
+ if (d == null) {
+ // date currently null, use the value from calendarPanel
+ // (~ client time at the init of the widget)
+ d = (Date) calendar.getDate().clone();
+ }
d.setHours(hour);
d.setMinutes(min);
d.setSeconds(sec);
|