aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/DateField.java
diff options
context:
space:
mode:
authorMatti Hosio <mhosio@vaadin.com>2014-12-17 10:31:33 +0200
committerMatti Hosio <mhosio@vaadin.com>2014-12-17 10:31:33 +0200
commite547f024533bef83b8c8c8e522240f34765c894d (patch)
tree4610ad629b996df6d7882a8f9190922a467046d2 /server/src/com/vaadin/ui/DateField.java
parent8a0a1bdb4630f39214a039a2689bfa5a1431a413 (diff)
parenta9f24b00e9ddcd5ca19ac2907e0bf2413f036af4 (diff)
downloadvaadin-framework-e547f024533bef83b8c8c8e522240f34765c894d.tar.gz
vaadin-framework-e547f024533bef83b8c8c8e522240f34765c894d.zip
Merge remote-tracking branch 'origin/master' into declarative
Conflicts: server/src/com/vaadin/ui/TextField.java Change-Id: I289cb9ec80d494ab79aec11a43708abf5b403a00
Diffstat (limited to 'server/src/com/vaadin/ui/DateField.java')
-rw-r--r--server/src/com/vaadin/ui/DateField.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/server/src/com/vaadin/ui/DateField.java b/server/src/com/vaadin/ui/DateField.java
index 030bd5f6c2..3d683f4902 100644
--- a/server/src/com/vaadin/ui/DateField.java
+++ b/server/src/com/vaadin/ui/DateField.java
@@ -316,10 +316,11 @@ public class DateField extends AbstractField<Date> implements
throw new IllegalStateException(
"startDate cannot be later than endDate");
}
- getState().rangeStart = startDate;
- // rangeStart = startDate;
- // This has to be done to correct for the resolution
- // updateRangeState();
+
+ // Create a defensive copy against issues when using java.sql.Date (and
+ // also against mutable Date).
+ getState().rangeStart = startDate != null ? new Date(
+ startDate.getTime()) : null;
updateRangeValidator();
}
@@ -436,8 +437,11 @@ public class DateField extends AbstractField<Date> implements
throw new IllegalStateException(
"endDate cannot be earlier than startDate");
}
- // rangeEnd = endDate;
- getState().rangeEnd = endDate;
+
+ // Create a defensive copy against issues when using java.sql.Date (and
+ // also against mutable Date).
+ getState().rangeEnd = endDate != null ? new Date(endDate.getTime())
+ : null;
updateRangeValidator();
}