From b6e66dd76ec744b5e779905060eeaa29783352d2 Mon Sep 17 00:00:00 2001 From: Sauli Tähkäpää Date: Sun, 14 Sep 2014 01:01:21 +0300 Subject: Assign timezone before setting initial date in DateField. (#14653) Change-Id: I3b527084d23ee8bd49887bef3d018c1003f492e2 --- server/src/com/vaadin/ui/DateField.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'server') diff --git a/server/src/com/vaadin/ui/DateField.java b/server/src/com/vaadin/ui/DateField.java index e88d767bc9..030bd5f6c2 100644 --- a/server/src/com/vaadin/ui/DateField.java +++ b/server/src/com/vaadin/ui/DateField.java @@ -815,17 +815,15 @@ public class DateField extends AbstractField implements // Clone the instance final Calendar newCal = (Calendar) calendar.clone(); - // Assigns the current time tom calendar. - final Date currentDate = getValue(); - if (currentDate != null) { - newCal.setTime(currentDate); - } - final TimeZone currentTimeZone = getTimeZone(); if (currentTimeZone != null) { newCal.setTimeZone(currentTimeZone); } + final Date currentDate = getValue(); + if (currentDate != null) { + newCal.setTime(currentDate); + } return newCal; } -- cgit v1.2.3