blob: 3016b8ae1a5c16f2629b7c340756b1556b123f2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
package com.vaadin.tests.components.datefield;
import java.time.LocalDate;
import java.util.Locale;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.ui.datefield.DateResolution;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.tests.components.TestDateField;
import com.vaadin.ui.AbstractLocalDateField;
public class CustomDateFormat extends AbstractTestUI {
@Override
protected void setup(VaadinRequest request) {
Locale locale = new Locale("fi", "FI");
AbstractLocalDateField df = new TestDateField();
df.setResolution(DateResolution.DAY);
df.setLocale(locale);
df.setWidth("300px");
String pattern = "d. MMMM'ta 'yyyy 'klo'";
df.setDateFormat(pattern);
df.setValue(LocalDate.of(2010, 1, 1));
addComponent(df);
}
@Override
protected String getTestDescription() {
return "Month name should be visible in text box if format pattern includes it";
}
@Override
protected Integer getTicketNumber() {
return 3490;
}
}
|