diff options
author | Ilia Motornyi <elmot@vaadin.com> | 2017-08-02 13:30:55 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-08-02 13:30:55 +0300 |
commit | 7b9a09edbf27269eaade3898ea49aa4d81efd927 (patch) | |
tree | 3a8938c9a9722d818cc31b8bb99964fafc14dfd8 /documentation/components | |
parent | f12a23c9c6bb176dd0550f07d6ddeb1e91c84bfc (diff) | |
download | vaadin-framework-7b9a09edbf27269eaade3898ea49aa4d81efd927.tar.gz vaadin-framework-7b9a09edbf27269eaade3898ea49aa4d81efd927.zip |
Fix AbstractDateField parsing and errors handling, support locale (#9740)
Fixes #9518
Fixes #8991
Fixes #8687
Diffstat (limited to 'documentation/components')
-rw-r--r-- | documentation/components/components-datefield.asciidoc | 5 |
1 files 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<LocalDate> 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"); } |