]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix broken DateField for ValoThemeTestUI
authorPekka Hyvönen <pekka@vaadin.com>
Mon, 3 Oct 2016 10:44:49 +0000 (13:44 +0300)
committerVaadin Code Review <review@vaadin.com>
Tue, 4 Oct 2016 05:45:28 +0000 (05:45 +0000)
Change-Id: Ia21f8acb317bb6c3643e4923ce7c774345821f93

uitest/src/main/java/com/vaadin/tests/themes/valo/DateFields.java

index 4346d1c64b2765ba69296cd29ff4a6e590a1975d..b92461be8b06652fcd3ede140384e0cf4a3456f4 100644 (file)
@@ -16,6 +16,7 @@
 package com.vaadin.tests.themes.valo;
 
 import java.time.LocalDate;
+import java.util.Date;
 import java.util.Locale;
 
 import com.vaadin.navigator.View;
@@ -175,7 +176,7 @@ public class DateFields extends VerticalLayout implements View {
         row.addComponent(date);
 
         PropertysetItem item = new PropertysetItem();
-        item.addItemProperty("date", new ObjectProperty<>(getDefaultDate()));
+        item.addItemProperty("date", new ObjectProperty<>(getDefaultOldDate()));
 
         FormLayout form = new FormLayout();
         form.setMargin(false);
@@ -207,6 +208,14 @@ public class DateFields extends VerticalLayout implements View {
         }
     }
 
+    private Date getDefaultOldDate() {
+        if (ValoThemeUI.isTestMode()) {
+            return new Date(2014 - 1900, 5, 7);
+        } else {
+            return new Date();
+        }
+    }
+
     @Override
     public void enter(ViewChangeEvent event) {
         // TODO Auto-generated method stub