Open m-escher opened 6 years ago
I have the same issue. But for me it would make sense to "autocomplete" it to 20xx if only 2 digits are entered, and for some usecases, where e.g. 0018 is entered and needed, it must not be transformed to 2018.
What i need to know is, what exactly entered the user? 01.01.18 OR 01.01.0018 ? Why can't i access newDateString
from update()
- rpc in AbstractDateField
somehow or Override doSetValue
with the real user input (not already processed date)?
When the Dateformat of a DateField-Component is set to "dd.MM.yyyy" any input String with a 2-digit year is parsed with leading zeroes: "08.01.18" -> " "08.01.0018".
After chatting with one of the Vaadin Experts (Olli) he suggested following workaround (Vaadin 7.7.7):
This fix seems to work just fine but isn't quite the cleanest solution. Maybe there could be some out of the box Solution for handling 2-digit years within a 4-digit year Format.
Here are some other links regarding this behaviour: https://stackoverflow.com/questions/5143763/is-it-possible-to-create-a-dateformatter-which-converts-a-two-digit-year-into-a https://github.com/vaadin/framework/issues/6083