summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeemu Pöntelin <teemu@vaadin.com>2014-12-08 23:21:08 +0200
committerVaadin Code Review <review@vaadin.com>2014-12-09 08:59:06 +0000
commit206055708b0a8e1c17a8c63d482a5e202d3ebf6d (patch)
treefaf2a993be3b18a8d10b28e64718c3e91a250810 /server
parent7e8b23a73a5dd1bef54b8fc5ddc4d3c431c298af (diff)
downloadvaadin-framework-206055708b0a8e1c17a8c63d482a5e202d3ebf6d.tar.gz
vaadin-framework-206055708b0a8e1c17a8c63d482a5e202d3ebf6d.zip
Fix issues when using java.sql.Date as DateField range (#15342)
Change-Id: I656cc0600f929239605e17ab9cf71dc1ba96582f
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/ui/DateField.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/server/src/com/vaadin/ui/DateField.java b/server/src/com/vaadin/ui/DateField.java
index 030bd5f6c2..d5700c4b65 100644
--- a/server/src/com/vaadin/ui/DateField.java
+++ b/server/src/com/vaadin/ui/DateField.java
@@ -316,10 +316,10 @@ 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 = new Date(startDate.getTime());
updateRangeValidator();
}
@@ -436,8 +436,10 @@ 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 = new Date(endDate.getTime());
updateRangeValidator();
}