aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/DateField.java
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2013-04-12 10:09:10 +0300
committerJohn Ahlroos <john@vaadin.com>2013-04-12 10:09:10 +0300
commit0f7af13adf1b5451842fc35a00d873ddb1a2e577 (patch)
tree73903c018e187f857c0dba54c824ceec2fb6d597 /server/src/com/vaadin/ui/DateField.java
parentf36c5ed815e090357890e4d76551d0641a233c82 (diff)
downloadvaadin-framework-0f7af13adf1b5451842fc35a00d873ddb1a2e577.tar.gz
vaadin-framework-0f7af13adf1b5451842fc35a00d873ddb1a2e577.zip
Fixed date reset when calendar is first initialized #11387
Change-Id: I48a839cceeab3cfc6722657eac8681a8766ab396
Diffstat (limited to 'server/src/com/vaadin/ui/DateField.java')
-rw-r--r--server/src/com/vaadin/ui/DateField.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/DateField.java b/server/src/com/vaadin/ui/DateField.java
index 78c86ceb00..1a8955801b 100644
--- a/server/src/com/vaadin/ui/DateField.java
+++ b/server/src/com/vaadin/ui/DateField.java
@@ -19,8 +19,10 @@ package com.vaadin.ui;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
@@ -594,8 +596,11 @@ public class DateField extends AbstractField<Date> implements
calendar = Calendar.getInstance();
// Start by a zeroed calendar to avoid having values for lower
// resolution variables e.g. time when resolution is day
+ int min, field;
for (Resolution r : Resolution.getResolutionsLowerThan(resolution)) {
- calendar.set(r.getCalendarField(), 0);
+ field = r.getCalendarField();
+ min = calendar.getActualMinimum(field);
+ calendar.set(field, min);
}
calendar.set(Calendar.MILLISECOND, 0);
}