DateField dynamic locale change problems

I’ve been doing dynamic locale changing in our application. Things are going well except for some issues with the DateField. When I say dynamic I mean that the locale is changed with a click of a button without refreshing the page or that sort of things.

First problem is with the parse error and it’s message. Let’s say the user has the Finnish locale in the date field but is trying to input date in the en_US locale format. User gets parse error. Now say the user changes locale to en_US. After the locale change the previously incorrect date string would be now actually valid. However, I cannot find a way to re-evaluate the input string. In fact I cannot seem to even access the user input as the dateString member in DateField is private.

So what I could do is set the date format manually and that’s quite ok actually. But even then the problem remains how to change the parse error message while the error is showing. It doesn’t seem to immediately change when a new parse error message is set. The use case might not be the most common but I think it’s realistic.

The second problem. Say i have a DateField with resolution set to minutes and locale is set to Finnish. Now change the locale to en_US and try to open the pop up. This results in uncaught client side exception for me. I believe the reason is with the different time formats. In this case I cannot fix the problem by setting the date and time format manually as the pop up does not seem to care about that. I can force the English language locale to en_gb for the HH:mm time format and this works but it’s not very nice.