]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix documentation pr9740/r2
authorelmot <elmotelmot.vaadin.com>
Fri, 28 Jul 2017 15:54:57 +0000 (18:54 +0300)
committerelmot <elmotelmot.vaadin.com>
Fri, 28 Jul 2017 15:54:57 +0000 (18:54 +0300)
documentation/components/components-datefield.asciidoc

index 3cbba0588f5bde4266caec77970217313dcc47e3..6137bd0c3d6c13d32d1f1f10757e9b39324f3518 100644 (file)
@@ -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");
         }