From 7b9a09edbf27269eaade3898ea49aa4d81efd927 Mon Sep 17 00:00:00 2001 From: Ilia Motornyi Date: Wed, 2 Aug 2017 13:30:55 +0300 Subject: Fix AbstractDateField parsing and errors handling, support locale (#9740) Fixes #9518 Fixes #8991 Fixes #8687 --- documentation/components/components-datefield.asciidoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'documentation/components') 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"); } -- cgit v1.2.3