From 63b5f11988e249270e9bec8477f5fe88403a4c7f Mon Sep 17 00:00:00 2001 From: elmot Date: Fri, 28 Jul 2017 18:54:57 +0300 Subject: [PATCH] Fix documentation --- documentation/components/components-datefield.asciidoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/components/components-datefield.asciidoc b/documentation/components/components-datefield.asciidoc index 3cbba0588f..6137bd0c3d 100644 --- a/documentation/components/components-datefield.asciidoc +++ b/documentation/components/components-datefield.asciidoc @@ -121,10 +121,11 @@ in the following example. DateField date = new DateField("My Date") { @Override protected Result handleUnparsableDateString( - String dateString) { + String dateString) { try { // try to parse with alternative format - return Result.ok(LocalDate.of(dateString, myFormat)); + LocalDate parsedAtServer = LocalDate.parse(dateString, DateTimeFormatter.ISO_DATE); + return Result.ok(parsedAtServer); } catch (DateTimeParseException e) { return Result.error("Bad date"); } -- 2.39.5