Skip to content

4.2.0 for Vaadin 14

Compare
Choose a tag to compare
@johanneshayry johanneshayry released this 28 Feb 15:25
· 33 commits to master since this release

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);