diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/AbstractDateField.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/server/src/main/java/com/vaadin/ui/AbstractDateField.java b/server/src/main/java/com/vaadin/ui/AbstractDateField.java index 19b628b1f2..a4677e6ec3 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractDateField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractDateField.java @@ -38,6 +38,7 @@ import java.util.logging.Logger; import java.util.stream.Collectors; import java.util.stream.Stream; +import elemental.json.Json; import org.jsoup.nodes.Element; import com.googlecode.gentyref.GenericTypeReflector; @@ -119,7 +120,17 @@ public abstract class AbstractDateField<T extends Temporal & TemporalAdjuster & if (resolutions.isEmpty()) { Result<T> parsedDate = handleUnparsableDateString( dateString); - parsedDate.ifOk(v -> setValue(v, true)); + // If handleUnparsableDateString returns the same + // date as current, force update state to display + // correct representation + parsedDate.ifOk(v -> { + if (!setValue(v, true) + && !isDifferentValue(v)) { + updateDiffstate("resolutions", + Json.createObject()); + doSetValue(v); + } + }); if (parsedDate.isError()) { dateString = null; currentParseErrorMessage = parsedDate |