4.2.0 for Vaadin 14
DateFieldFormatter
Formats dates according to the given pattern, delimiter, maximum and minimum value.
TextField myDateField = new TextField();
new DateFieldFormatter.Builder()
.datePattern("yyyyMMdd")
.delimiter("-")
.dateMin(LocalDate.of(1900, 01, 01))
.dateMax(LocalDate.of(2019, 9, 3))
.build().extend(myDateField);
// or
TextField myDateField = new TextField();
new DateFieldFormatter(
"yyyyMMdd",
LocalDate.of(1900, 01, 01),
LocalDate.of(2019, 9, 3),
"-"
).extend(myDateField);